LiteLLM Proxy / Gateway
- Kind: OpenAI-compatible proxy — routes one OpenAI API surface to 100+ backend providers
- Official docs: https://docs.litellm.ai/docs/proxy/configs
- Cyberine adapter:
LoopAgentAdapter(idsloop-gateway-a,loop-gateway-b) - Researched/verified: 2026-06-07 — confidence medium (config structure confirmed; some defaults/aliases inferred).
- DeepSeek capability metadata re-verified 2026-08-24 (T686) — see DeepSeek ids (V4) and the vision gap below.
Base URL & auth
| Base URL | host http://localhost:41400 (Cyberine default GATEWAY_BASE_URL=http://localhost:41400/v1; uncommon on-demand port, container-internal stays 4000) |
| Auth header | Authorization: Bearer <master-key> |
| Master key | general_settings.master_key (must start with sk-) or LITELLM_MASTER_KEY env. Cyberine maps GATEWAY_API_KEY → master key. |
| Start | litellm --config litellm.config.yaml [--port 4000] [--host 0.0.0.0] [--debug] |
Cyberine runs it via
docker-compose up; defaultGATEWAY_API_KEY=sk-litellm-master-key.
Endpoints (OpenAI-compatible passthrough)
| Method + path | Purpose |
|---|---|
POST /chat/completions (also /v1/...) | Routes by model name to the backend. The endpoint Cyberine uses. |
POST /completions, /embeddings, /audio/speech, /audio/transcriptions, /images, /rerank | Other OpenAI-shaped routes. |
GET /models | List models from model_list. |
POST /key/generate | Create a virtual key (needs PostgreSQL DATABASE_URL to persist). |
GET /model/info, GET /health | Metadata + health. |
Configuration (litellm.config.yaml)
model_list:
- model_name: anthropic/claude # alias the client sends as `model`
litellm_params:
model: anthropic/claude-3-5-sonnet-20241022 # real provider/model upstream
api_key: os.environ/ANTHROPIC_API_KEY # NOTE the slash syntax
- model_name: openai/gpt
litellm_params:
model: gpt-4o
api_key: os.environ/OPENAI_API_KEY
general_settings:
master_key: os.environ/LITELLM_MASTER_KEYmodel_name= alias the client sends;litellm_params.model= real upstream id. Independent strings.litellm_params:model,api_key,api_base,api_version(Azure),rpm,tpm.router_settings:routing_strategy(simple-shuffle/least-busy/usage-based-routing/latency-based-routing),num_retries,fallbacks,model_group_alias.litellm_settings:drop_params,num_retries,request_timeout,success_callback, fallbacks, caching.
Models Cyberine routes through it
Alias (LOOP_MODEL_*) | Upstream example |
|---|---|
anthropic/claude (LOOP_MODEL_A) | anthropic/claude-3-5-sonnet-20241022 (or any Claude id) |
openai/gpt (LOOP_MODEL_B) | gpt-4o (or any OpenAI id) |
These two defaults are placeholders that signal "unconfigured" — override them with real upstream ids. Underlying provider docs: openai.md, anthropic.md.
DeepSeek ids (V4) and the vision gap — re-verified live 2026-08-24
LiteLLM's own maintained model_prices_and_context_window.json (the file its Router reads for
capability/cost metadata) was fetched raw via
curl https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json
and inspected as JSON (not a summarized fetch, so no field got dropped or mangled). It has these
DeepSeek V4 entries, all under "litellm_provider": "deepseek":
| Key in the JSON | supports_vision | supported_endpoints |
|---|---|---|
deepseek-v4-flash | false | ["/v1/chat/completions"] |
deepseek-v4-pro | false | ["/v1/chat/completions"] |
deepseek/deepseek-v4-flash | false | ["/v1/chat/completions"] |
deepseek/deepseek-v4-pro | false | ["/v1/chat/completions"] |
(There are also openrouter/deepseek/deepseek-v4-pro[-0813] entries under
"litellm_provider": "openrouter" — those describe LiteLLM proxying to OpenRouter as a backend,
a different configuration from the direct deepseek-* rows above; not what Cyberine's own
litellm.config.yaml example wires up today.)
Known limitation of this path: searching the same file for a DeepSeek entry with vision in
its key returns zero results — there is no deepseek-v4-flash-vision-exp row at all, dated
or otherwise. Every DeepSeek row that does exist is explicitly marked supports_vision: false.
So even though the underlying model accepts images (confirmed on openrouter.md
and deepseek.md), LiteLLM's own capability metadata gives a router no correct way
to learn that any DeepSeek id on this path can take an image — an image dispatch routed through
the LiteLLM gateway path has no metadata-backed vision route today. Do not configure
litellm.config.yaml to promise vision support for a DeepSeek model_name alias until this
file gains a vision-capable DeepSeek row upstream.
Notable features
- OpenAI-compatible REST — any OpenAI SDK works by pointing
base_urlat the proxy. - Streaming/tools passed through to backends.
os.environ/VARsyntax in any config value (resolved at startup).- Virtual keys (scoped sub-keys, budgets), router strategies, fallback chains.
- Spend tracking + budgets (needs PostgreSQL), Redis-backed routing, logging callbacks (langfuse/prometheus/otel/datadog), secret-manager and semantic-cache integrations.
Gotchas
- Endpoint path is
/chat/completionswith no/v1prefix internally, but/v1/...is also accepted. Set SDKbase_url=http://localhost:41400(the Cyberine host port; not.../v1) to avoid double-prefix — Cyberine'sGATEWAY_BASE_URLincludes/v1, which the proxy tolerates. - Config var syntax is
os.environ/VAR(forward slash), not${VAR}/$VAR. master_keymust start withsk-.- CLI default port is 4000; the server package's
PORTdefault is 8000 — don't confuse them. drop_params: truesilently strips unsupported params before forwarding — convenient but can mask errors.- Virtual keys are in-memory (lost on restart) without
DATABASE_URL.
Pricing
Open source (MIT) — no proxy cost; you pay the underlying providers. Hosted/enterprise: https://www.litellm.ai/pricing
Cyberine integration notes
loop-gateway-a/loop-gateway-b(read-only Q&A/compare adapters) register when ANYGATEWAY_*orLOOP_MODEL_*env var is explicitly set — including to the documented defaults, since a live local gateway athttp://localhost:41400/v1with theanthropic/claude+openai/gptaliases IS a real gateway (fixed 2026-06-07; the old heuristic read defaults as "unconfigured" and skipped a working gateway). This is the only path that needs Docker; the DeepSeek/Kimi/OpenRouter loop workers bypass it entirely.- WRITING fleet:
loop-claude-build(routesLOOP_MODEL_A) andloop-gpt-build(routesLOOP_MODEL_B) are sandbox-pinnedLoopAgentAdapterimplementers backed by the gateway — add them toCYBERINE_BUILD_FLEETto race Claude/GPT against the key-only DeepSeek/Kimi workers on a real implement task. They need the gateway up (docker compose up -d). - The gateway is what gives Cyberine access to OpenAI and Anthropic models without writing provider-specific code (provider independence via
baseURLswap).
Sources
- https://docs.litellm.ai/docs/proxy/configs
- https://docs.litellm.ai/docs/proxy/quick_start
- https://docs.litellm.ai/docs/proxy/virtual_keys
- https://docs.litellm.ai/docs/proxy/config_settings
- https://docs.litellm.ai/docs/providers/anthropic
- https://docs.litellm.ai/docs/providers/openai
- https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json (fetched raw 2026-08-24)
OpenAI API (Chat Completions + Responses)
The openai Node SDK constructor accepts a custom baseURL — this is how Cyberine points the same client at LiteLLM/OpenRouter/DeepSeek without code changes.
Moonshot AI / Kimi API
A vendor-independent multi-provider AI agent orchestrator: dispatch one task to many agents, judge the results, ship the winner.