https://api.tokios.com/v1, pass an sk-tok-… API key, and set model to your registered deployment name (for example, gemma-tunnel), not your local backend’s model id. If you’ve ever run a keyless local server, you’ve probably typed a throwaway string like "not-needed" just to satisfy a client that requires an API key field — with Tokios that field takes a real, revocable key instead.
Prerequisites
Install the connector
Pair
tokios-connector with your local backend.Register a deployment
Choose the public name your
model field will use.Create an API key
Generate an
sk-tok-… key, scoped to the deployments you need.Supported backends
Confirm Ollama, llama.cpp, vLLM, or LM Studio is wired up as the upstream.
Configure your framework
- LangChain
- LlamaIndex
- Vercel AI SDK
- Pydantic AI
LangChain’s
ChatOpenAI class takes a base_url and api_key like the OpenAI SDK it wraps:langchain_tokios.py
Across all four frameworks,
model is always the Tokios deployment name you registered in the Models tab — never the local model id your backend serves — and the base URL must include /v1. Omitting /v1 is the most common misconfiguration when adapting a snippet from a different OpenAI-compatible provider.FAQ
Why does LlamaIndex need is_chat_model and is_function_calling_model set explicitly?
Why does LlamaIndex need is_chat_model and is_function_calling_model set explicitly?
OpenAILike is a generic wrapper for OpenAI-compatible servers that don’t necessarily behave like OpenAI’s own chat models, so it doesn’t assume chat or function-calling support out of the box. Confirm the exact default values against your installed LlamaIndex version, and set both explicitly to match what your underlying deployment actually supports.Do I still need a dummy API key value?
Do I still need a dummy API key value?
No. Frameworks built against local, keyless servers often expect a placeholder string because the field is required but unchecked. Tokios keys are real
sk-tok-… credentials — created, scoped, and revoked from the Keys tab — so the API key field does actual authentication instead of satisfying a client-side check.Does streaming work in these frameworks?
Does streaming work in these frameworks?
Yes. Tokios returns standard OpenAI-format SSE when a request sets
"stream": true, so each framework’s native streaming support (for example, LangChain’s .stream() or the Vercel AI SDK’s streamText) works the same as it would against OpenAI directly.Now call it from anywhere
Your backend still runs on localhost — the connector only dials out, and nothing you configured above changes that. What changes is who can reach it: once a teammate or a deployed agent has a scopedsk-tok-… key, the same LangChain, LlamaIndex, Vercel AI SDK, or Pydantic AI code that worked against your machine works from theirs.
Compatible clients
See the full list of OpenAI- and Anthropic-compatible clients Tokios works with.
API keys
Create a separate scoped key per teammate or agent.