Connect models
Every model call on Kleinia goes through one system service, the unified model gateway. You add your models to it once; agents never see your keys.
- One endpoint. The gateway speaks the OpenAI and Anthropic APIs. Your session’s environment already points model clients at it, so agents pick it up without configuration.
- Local and cloud. Cloud providers and models running on your own machine plug in side by side, and can be swapped without touching any agent.
- Limits the system keeps. Tokens are metered per agent, and model permissions and quotas are enforced by the system.
Add a cloud provider
Section titled “Add a cloud provider”Open Model Gateway from the app grid, choose Add source, and enter:
- the provider’s API type (OpenAI-compatible or Anthropic),
- its base URL,
- your API key,
- the models you want to offer to agents.
Or from a terminal:
llmgwctl source add myprovider --type openai \ --base https://api.example.com/v1 \ --key-file ~/myprovider.key \ --model example-modelThe key is stored by the gateway, readable only by the system. You can delete the key file afterwards.
Add a local model
Section titled “Add a local model”Run any local inference server that exposes an OpenAI-compatible API, then add it as a source the same way, with its local address as the base URL. Calls to a local model never leave the machine.
Set limits per agent
Section titled “Set limits per agent”In Model Gateway, each agent that has called a model is listed with its token use. For each one you can choose which models it may use and set a token quota. An agent that reaches its quota is stopped from making further calls until the quota resets or you raise it.
Check usage
Section titled “Check usage”agenttop # tokens per agent, liveagentctl trace # model calls, step by stepSee Monitor agents.
Programs that bring their own key
Section titled “Programs that bring their own key”A program that is configured with its own API key and endpoint keeps working, but its calls bypass the gateway: they are not metered or limited, and the key stays in that program’s configuration. Remove the program’s own key to let the gateway handle it.
© 2026 The Kleinia AuthorsStarted and maintained by the VIPA Lab