Miget is now Lyngbak. Same platform, same plans, same API.Why the name →

Startups get $300 or more in Lyngbak credits.Apply →

Moving production infrastructure? We migrate it for you, free.Talk to us →

PricingEnterpriseDashboard
Start for Free
← All templates

LiteLLM

One OpenAI-compatible gateway for every LLM provider - virtual keys, budgets, spend tracking - with no percentage fee.

3 GiB

2 services, 5 GB disk

$24/mo

flat resource

$0.037/h

Usage Billing

What is LiteLLM?

Every team using LLMs converges on the same needs: one endpoint instead of five SDKs, per-team API keys instead of the shared provider key in a Slack DM, budgets before the invoice surprise, and a log of who spent what on which model. LiteLLM is the open-source gateway that does exactly this - an OpenAI-compatible proxy in front of 100+ providers.

This template runs the database-backed mode on a managed Postgres: virtual keys, teams, budgets, and spend logs all persist, and models are managed in the admin UI (/ui) with no config file - STORE_MODEL_IN_DB keeps provider credentials encrypted in the database.

The hosted alternatives take a cut or meter your logs; OpenRouter adds 5.5% on credits, Portkey meters logged requests. A self-hosted gateway charges neither - your provider keys, your spend caps, LAN latency from the agents in your project.

What you get

  • OpenAI-compatible /v1 endpoint for 100+ providers (Anthropic, OpenAI, Gemini, Bedrock, Mistral, …)
  • Virtual keys with per-key/team budgets, rate limits, and model allowlists
  • Spend tracking per key, team, and model in Postgres
  • Fallbacks, retries, and load balancing across deployments
  • Admin UI at /ui - add models and mint keys without redeploys
  • No config.yaml: models and encrypted provider keys live in the DB

How it runs on Lyngbak

ServiceRolePublic
litellmproxy + admin UI (:5000, key-authenticated)yes
dbPostgres - managed service on Lyngbak, container locallyno

Before you deploy

  • LITELLM_MASTER_KEY

    admin key - must start with sk-

  • LITELLM_SALT_KEY

    encrypts stored provider keys (openssl rand -hex 32); set before adding the first model, cannot rotate after

Sizing and billing

2 GiB suits a single proxy instance for team workloads (official prod guidance is 4 GiB per worker - size up under heavy concurrency). The container is stateless; Postgres holds everything.

Hobby resource$24/mo2 vCPU, 2 GiB + 1 GiB RAM add-on, 60 GiB disk, shared CPU
Pro resource$30/mo1 vCPU, 2 GiB + 1 GiB RAM add-on, 10 GiB disk, dedicated CPU
Usage Billing, shared CPU$0.037/h1.5 vCPU, 3 GiB reserved. $27/mo for a full month, billed by the second.
Usage Billing, dedicated CPU$0.094/h2 vCPU, 4 GiB reserved. $68/mo for a full month, billed by the second.

A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 5 GiB of volumes cost $0.15 per GiB a month ($0.75/mo) for as long as they exist. One workspace can use both. See pricing

Compared with the managed service

ServicePlanPriceIncludes
OpenRouterpay-as-you-goUsage-based5.5% fee on credit purchases on top of provider model prices
PortkeyProduction$49/mo100k logs/mo, then $9 per extra 100k; 30-day retention

A self-hosted gateway adds no percentage fee and no log metering - your provider keys, your spend caps, LAN latency to your apps. Prices from each vendor's pricing page, June 2026.

Run it locally first

The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.

Questions

How does this compare to OpenRouter?

OpenRouter is excellent for instant multi-model access but adds a 5.5% fee on credits and routes your traffic through their infrastructure. Self-hosted LiteLLM uses your own provider keys at raw provider prices, keeps prompts inside your network, and adds the team controls (budgets, virtual keys) OpenRouter does not.

Do my existing OpenAI-SDK apps work with it?

Yes - that is the design. Point base_url at your gateway (http://litellm:5000/v1 in-project, or the public domain) with a virtual key, and the same SDK call can hit Claude, GPT, or Gemini depending on the model name and your routing config.

Where do provider API keys live?

Encrypted in Postgres using LITELLM_SALT_KEY, managed through the admin UI. Generate the salt key before adding the first model and never rotate it - it cannot be changed once credentials are stored.

Is it safe to expose the proxy publicly?

Every request requires a key (master or virtual), so the public domain is usable by external clients. For purely internal use, in-project apps can call http://litellm:5000 and you can keep usage gated by virtual keys per team or agent.

Does it pair with the other LLM templates here?

Naturally: point agent-box, OpenClaw, or Hermes at the gateway for spend caps per agent, and send LiteLLM callbacks to the langfuse template for tracing - the whole LLM platform, self-hosted in one project.

Read the production guide →

Works well with

Open WebUI

The self-hosted AI chat workspace - any model behind one UI, RAG over your documents, no per-seat pricing.

Open the template →

Langfuse

Open-source LLM observability - tracing, evals, prompt management - the full v3 stack with no per-unit metering.

Open the template →

Ollama

Run open LLMs behind a simple API - llama, mistral, qwen. The local-model server (GPU recommended).

Open the template →
LiteLLM proxy: LLM gateway with Docker Compose | Lyngbak (formerly Miget)