[{"data":1,"prerenderedAt":145},["ShallowReactive",2],{"seo-verification":3,"blog-self-host-litellm-on-a-vps-your-private-llm-api-gateway-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"slugs":9,"title":12,"excerpt":13,"readTime":14,"views":15,"isPinned":16,"publishedAt":17,"category":18,"categories":24,"featuredImage":26,"bgImage":27,"posterImage":28,"relatedSolution":29,"intro":32,"sections":33,"ctaTitle":85,"ctaBody":86,"ctaButton":87,"ctaUrl":88,"relatedPosts":89},156,"self-host-litellm-on-a-vps-your-private-llm-api-gateway",{"fr":10,"en":8,"ar":11},"self-host-litellm-vps","استضف-litellm-ذاتيا-على-vps-بوابة-api-خاصة-لنماذج-llm","Self-Host LiteLLM on a VPS: Your Private LLM API Gateway","Deploy LiteLLM on a ServOrbit VPS — a self-hosted, OpenAI-compatible gateway to Ollama, Anthropic, Azure and 100+ LLM providers, with spend tracking and rate limits.",4,0,false,"2026-01-21T00:00:00+00:00",{"id":19,"name":20,"slug":21,"color":22,"icon":23},7,"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[25],{"id":19,"name":20,"slug":21,"color":22,"icon":23},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fself-host-litellm-vps-poster.svg",{"categorySlug":30,"appSlug":31},"artificial-intelligence","litellm","Your application calls one endpoint. LiteLLM decides which model handles the request — your local Ollama, Anthropic Claude, GPT-4, or any of 100+ other providers. It speaks OpenAI's API so no SDK change is ever needed. Self-hosted on a VPS, it adds rate limiting, budget caps per API key, and a built-in analytics dashboard — so you can give multiple teams access to AI without worrying about runaway costs.",[34,38,48,51,79,82],{"type":35,"title":36,"body":37},"h2","Why LiteLLM is the missing layer for self-hosted AI stacks","Ollama is great for running local models. Open WebUI wraps it in a chat interface. But the moment you start building applications — not just chatting — you need something in between: a proxy that normalises the API surface, tracks costs per project, and lets you swap models without touching app code. That is exactly what LiteLLM does. It sits between your application and any LLM backend, exposing a single OpenAI-compatible endpoint. Your code stays the same whether you route to Llama 3.1 on Ollama, Claude 3.5 Haiku, or GPT-4o.",{"type":39,"title":40,"items":41},"ul","What LiteLLM gives you out of the box",[42,43,44,45,46,47],"Unified OpenAI-compatible API — works with every SDK, library and tool that targets the OpenAI API.","100+ provider integrations: Ollama, Anthropic, OpenAI, Azure OpenAI, Mistral, Cohere, Bedrock and more.","Virtual API keys with per-key spend limits and rate limits — issue keys to teams and cap monthly costs.","Built-in dashboard at \u002Fui with real-time spend analytics, per-model breakdowns and request logs.","Load balancing and automatic failover across multiple provider endpoints or model replicas.","Apache 2.0 licence — no telemetry, no phoning home, fully air-gap capable when paired with Ollama.",{"type":35,"title":49,"body":50},"Requirements","A VPS with at least 1 GB RAM and Ubuntu 22.04. Docker and the Compose plugin installed. Port 4000 open, or a Caddy\u002FNginx reverse proxy for HTTPS. That is everything — LiteLLM itself is a Python proxy and needs around 256 MB; PostgreSQL takes most of the remaining RAM budget. For teams with concurrent traffic, 2 GB is more comfortable.",{"type":52,"title":53,"steps":54},"steps","Deploy LiteLLM on a VPS",[55,58,61,64,67,70,73,76],{"title":56,"body":57},"Provision the VPS","Order a ServOrbit VPS (1 GB RAM minimum, Ubuntu 22.04). SSH in and install Docker: `curl -fsSL https:\u002F\u002Fget.docker.com | sh`. The Compose plugin is included.",{"title":59,"body":60},"Generate secrets","Run `openssl rand -hex 32` to generate LITELLM_MASTER_KEY — this unlocks the dashboard and all admin API endpoints. Create `\u002Fopt\u002Flitellm\u002F.env` with: `LITELLM_MASTER_KEY`, `UI_USERNAME`, `UI_PASSWORD`, `DB_NAME=litellm`, `DB_USER=litellm`, `DB_PASSWORD=\u003Cstrong-password>`.",{"title":62,"body":63},"Write docker-compose.yml","Create `\u002Fopt\u002Flitellm\u002Fdocker-compose.yml` with two services: `db` (postgres:16-alpine, env vars from .env, volume litellm_db) and `litellm` (ghcr.io\u002Fberriai\u002Flitellm:main-latest, port 4000:4000, depends_on db, DATABASE_URL + LITELLM_MASTER_KEY + UI_USERNAME + UI_PASSWORD, volume litellm_config:\u002Fapp\u002Fdata). Run `docker compose up -d`.",{"title":65,"body":66},"Open the dashboard","Navigate to `http:\u002F\u002F\u003Cvps-ip>:4000\u002Fui` and log in with your UI_USERNAME \u002F UI_PASSWORD. You will land on the LiteLLM dashboard. Go to Models to add your first provider. For a local Ollama instance on the same VPS, set model name to `ollama\u002Fllama3.1` and API base to `http:\u002F\u002Fhost.docker.internal:11434`. For Anthropic, paste your API key and add `anthropic\u002Fclaude-3-5-haiku-20241022`.",{"title":68,"body":69},"Test the gateway","From your workstation, test: `curl http:\u002F\u002F\u003Cvps-ip>:4000\u002Fv1\u002Fchat\u002Fcompletions -H \"Authorization: Bearer \u003CLITELLM_MASTER_KEY>\" -H 'Content-Type: application\u002Fjson' -d '{\"model\": \"ollama\u002Fllama3.1\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]}'`. You should get a streamed response back — routed through LiteLLM to your Ollama.",{"title":71,"body":72},"Issue team API keys","In the dashboard under API Keys, click New Key. Give it a description (e.g. 'frontend-team'), set `max_budget: 50` (USD\u002Fmonth) and an optional `tpm_limit`. Share this key with the team — they point their OpenAI SDK at `http:\u002F\u002F\u003Cvps-ip>:4000` and use this key. Spend is tracked per key in the dashboard.",{"title":74,"body":75},"Add HTTPS with Caddy","Install Caddy: `apt install -y caddy`. Edit `\u002Fetc\u002Fcaddy\u002FCaddyfile`: `llm.yourdomain.com { reverse_proxy localhost:4000 }`. Reload: `systemctl reload caddy`. Close port 4000 in your firewall — all traffic now flows through 443 with automatic TLS.",{"title":77,"body":78},"Logging in for the first time","Open the admin interface at \u002Fui: LiteLLM displays a username\u002Fpassword form. Enter admin and the password provided, then create your virtual keys from the dashboard.",{"type":80,"body":81},"tip","Pair LiteLLM with Ollama on the same VPS for a fully air-gapped AI stack. Ollama handles model inference; LiteLLM adds the gateway layer — routing, rate limiting and usage tracking. For privacy-sensitive workloads (legal, finance, medical), this means zero data leaves your infrastructure.",{"type":80,"title":83,"body":84},"The official documentation","For advanced configuration and options specific to the tool, refer to the \u003Ca href=\"https:\u002F\u002Fdocs.litellm.ai\" target=\"_blank\" rel=\"noopener noreferrer\">official LiteLLM documentation\u003C\u002Fa>. This guide covers going live on a VPS; the vendor's documentation remains the reference for fine-tuning, major updates and specific use cases.","Deploy your private LLM gateway","Self-host LiteLLM on a ServOrbit VPS — route between Ollama, Anthropic and 100+ providers from a single OpenAI-compatible endpoint, with per-key budget controls.","Deploy LiteLLM","\u002Fmarketplace\u002Fartificial-intelligence\u002Flitellm",[90,111,127],{"id":91,"slug":92,"slugs":93,"title":96,"excerpt":97,"readTime":98,"views":15,"isPinned":16,"publishedAt":99,"category":100,"categories":106,"featuredImage":26,"bgImage":27,"posterImage":108,"relatedSolution":109},11,"how-to-host-ollama-on-a-vps",{"fr":94,"en":92,"ar":95},"heberger-ollama-vps","كيفية-استضافة-ollama-على-خادم-vps","Hosting Ollama on a VPS: advanced operational guide","Advanced Ollama VPS setup: model management, nginx reverse proxy, API security, Q4_K_M\u002FQ8 quantization, CVE-2026-45672 Open WebUI and secure coupling.",10,"2026-06-09T00:00:00+00:00",{"id":101,"name":102,"slug":103,"color":104,"icon":105},1,"Artificial Intelligence","intelligence-artificielle","bg-purple-500\u002F10 text-purple-400","ia",[107],{"id":101,"name":102,"slug":103,"color":104,"icon":105},"\u002Fblog\u002Fcovers\u002Fheberger-ollama-vps-poster.svg",{"categorySlug":30,"appSlug":110},"ollama",{"id":112,"slug":113,"slugs":114,"title":117,"excerpt":118,"readTime":119,"views":15,"isPinned":16,"publishedAt":120,"category":121,"categories":122,"featuredImage":26,"bgImage":27,"posterImage":124,"relatedSolution":125},2,"deploying-dify-on-a-vps-ai-workflows-under-control",{"fr":115,"en":113,"ar":116},"deployer-dify-vps","نشر-dify-على-vps-سير-عمل-الذكاء-الاصطناعي-تحت-السيطرة","Deploying Dify on a VPS: AI Workflows Under Control","Install Dify on a ServOrbit VPS to build agents, chatflows and AI apps without losing control of your data.",3,"2026-02-11T00:00:00+00:00",{"id":101,"name":102,"slug":103,"color":104,"icon":105},[123],{"id":101,"name":102,"slug":103,"color":104,"icon":105},"\u002Fblog\u002Fcovers\u002Fdeployer-dify-vps-poster.svg",{"categorySlug":30,"appSlug":126},"dify",{"id":119,"slug":128,"slugs":129,"title":132,"excerpt":133,"readTime":91,"views":15,"isPinned":16,"publishedAt":134,"category":135,"categories":139,"featuredImage":26,"bgImage":27,"posterImage":141,"relatedSolution":142},"install-n8n-on-vps-with-docker-complete-2026-guide",{"fr":130,"en":128,"ar":131},"installer-n8n-vps","تثبيت-n8n-على-vps-مع-docker-دليل-شامل-2026","Install n8n on VPS with Docker: complete 2026 guide","Deploy n8n on VPS with Docker Compose, reverse proxy, HTTPS and webhooks. Covers V8 crash >30 workflows, 502 nginx timeout and npm to Docker migration before v3.0.","2026-06-05T00:00:00+00:00",{"id":112,"name":136,"slug":137,"color":138,"icon":137},"Automation","automatisation","bg-brand-action\u002F10 text-brand-action",[140],{"id":112,"name":136,"slug":137,"color":138,"icon":137},"\u002Fblog\u002Fcovers\u002Finstaller-n8n-vps-poster.svg",{"categorySlug":143,"appSlug":144},"automation-workflows","n8n",1787581013706]