Skip to content

ModelKit

ModelKit is the unified model gateway inside AgentOS.
If your app already has its own complex agent, or if you only need direct model access, this is usually the best place to start.

What it solves

Its main value is that developers do not have to solve model sourcing first.

It exposes model capabilities by task:

TaskRoute prefixDescription
chat/modelkit/chatText and vision models through the OpenAI chat completions protocol
embedding/modelkit/embeddingText embeddings
asr/modelkit/asrSpeech-to-text
tts/modelkit/ttsText-to-speech

Best fit

  • you already own the agent runtime and only need the model-calling layer
  • you want to call models directly through the AgentOS SDK or OpenAI-compatible protocol
  • you want one gateway for text, multimodal, TTS, ASR, and embeddings

Most common usage

Use the AgentOS SDK

Both TypeScript and Dart SDKs expose ModelKit through sdk.modelkit.

ts
import { AgentOSSDK, ModelTask } from 'agentos-sdk-ts';

const sdk = new AgentOSSDK({ baseUrl: 'http://127.0.0.1:8888' });
const chatModels = await sdk.modelkit.listModelsByTask(ModelTask.chat);

const completion = await sdk.modelkit.chat.create({
  model: chatModels[0].id,
  messages: [{ role: 'user', content: 'Hello from ModelKit.' }]
});

Use the OpenAI SDK directly

AgentOS task routes expose OpenAI-compatible protocols, so in many cases you can use the official OpenAI SDK directly. Make sure baseURL points to the specific task prefix.

Parameter mapping:

OpenAI SDK fieldAgentOS source
baseURLFor chat, ${baseUrl}/modelkit/chat/v1, where baseUrl comes from root GET /
apiKeybearer token returned by AppKit registration
modelmodel.id from sdk.modelkit.listModelsByTask(ModelTask.chat)

Capability scope

  • chat completions: /modelkit/chat/v1/chat/completions
  • image-related model input: still use /modelkit/chat; check capabilities.vision
  • tts: /modelkit/tts/v1/audio/speech
  • asr: /modelkit/asr/v1/audio/transcriptions
  • embeddings: /modelkit/embedding/v1/embeddings

When ModelKit should not be your first stop

  • you need more than model calls and want the platform to orchestrate the agent and tool chain
  • you need ready-made RAG services rather than standalone embeddings

In those cases, start with:

Next steps