EQVPS

Self-host a LiteLLM proxy on a VPS: one OpenAI-compatible endpoint for every model

Sep 2, 2026 · 3 min read · EQVPS Team

If you run more than one app — or one agent that fans out to several models — you eventually hit the same wall: every provider has its own SDK, its own keys, its own rate limits, and no single place to see spend. LiteLLM fixes that by putting one OpenAI-compatible endpoint in front of everything. Your code calls one URL with a model name; LiteLLM routes it to OpenAI, Anthropic, Groq, Together, Mistral, a local Ollama — whatever you configured — and gives you budgets, fallbacks, and one log of every call.

Self-hosting it on a VPS means your provider keys, your prompts and your spend data live on a box you control, paid for in crypto with no KYC.

What a LiteLLM proxy needs

Docker setup (Ubuntu 24.04)

# dedicated-IP plan, root shell
apt update && apt install -y docker.io docker-compose-v2
systemctl enable --now docker

mkdir -p /opt/litellm && cd /opt/litellm
cat > config.yaml <<'EOF'
model_list:
  - model_name: gpt-4o
    litellm_params:
      model: openai/gpt-4o
      api_key: os.environ/OPENAI_API_KEY
  - model_name: claude
    litellm_params:
      model: anthropic/claude-sonnet-4-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: local-llama
    litellm_params:
      model: ollama/llama3.1
      api_base: http://host.docker.internal:11434
general_settings:
  master_key: sk-CHANGE-ME          # admin key; issue per-app virtual keys instead
EOF

cat > docker-compose.yml <<'EOF'
services:
  litellm:
    image: ghcr.io/berriai/litellm:main-latest
    restart: always
    ports: [ "127.0.0.1:4000:4000" ]
    environment:
      OPENAI_API_KEY: sk-...            # your provider keys
      ANTHROPIC_API_KEY: sk-ant-...
      DATABASE_URL: postgresql://litellm:change_me@postgres:5432/litellm
    volumes: [ ./config.yaml:/app/config.yaml ]
    command: [ "--config", "/app/config.yaml" ]
  postgres:
    image: postgres:16
    restart: always
    environment:
      POSTGRES_USER: litellm
      POSTGRES_PASSWORD: change_me
      POSTGRES_DB: litellm
    volumes: [ ./pgdata:/var/lib/postgresql/data ]
EOF

docker compose up -d

Put Caddy or Nginx in front for automatic HTTPS on your domain, then any OpenAI SDK just works:

curl https://llm.yourdomain.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-virtual-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude","messages":[{"role":"user","content":"ping"}]}'

Why this is great for agents

An AI agent or a multi-agent fleet usually makes a lot of model calls. Behind a LiteLLM proxy you can: cap each agent with its own virtual key and budget, fall back from a frontier model to a cheaper one automatically, mix a local Ollama with cloud APIs, and read one log of exactly what every agent spent. Swap models without touching agent code — just change the config.

Why EQVPS for a LiteLLM gateway

VPS for AI agents → · Self-host Ollama on a VPS →

FAQ

What does a LiteLLM proxy actually give me?

One OpenAI-compatible endpoint in front of many providers. Your apps and agents call a single URL and model name; LiteLLM routes to OpenAI, Anthropic, Groq, Together, a local Ollama, etc. You get per-key budgets, rate limits, fallbacks and one place for logs and cost — without changing app code when you switch models.

Which plan does it need?

LiteLLM itself is light — Small ($8/mo, 4 GB RAM) is comfortable for the proxy plus Postgres for keys/spend. It's a gateway, not an inference box: the heavy compute runs at the providers (or on a separate GPU/host). Take a dedicated-IP plan so you can put a domain and HTTPS in front.

Why self-host instead of using a hosted gateway?

Your provider keys, prompts, spend data and logs stay on a machine you control instead of a third party's. You set the budgets and see every request. For agents that fan out a lot of calls, that visibility and cost control is the whole point.

Does it work with local models too?

Yes. Point one of the LiteLLM model entries at a local Ollama (same VPS or another box) and it's exposed through the same OpenAI-compatible API as the cloud models — so an app can mix a cheap local model and a frontier API behind one endpoint.

Do you ask for ID or a card?

No. Register with an email, pay in USDC or USDT. No documents, no card, no KYC.

← Back to blogSee plans & pricing →

Comments

No comments yet. Be the first.

Leave a comment

Comments are moderated before they appear.