---
slug: litellm
kind: runbook
status: docs-checked
sh: https://insidethemachine.ai/install/litellm.sh
ps1: https://insidethemachine.ai/install/litellm.ps1
json: https://insidethemachine.ai/install/litellm.json
page: https://insidethemachine.ai/setups/litellm
---

# Install: LiteLLM

One OpenAI-format API (SDK or proxy) in front of 100+ providers, including your local models.

**Run status: Not run: commands checked against the official docs only.** Commands checked against the official docs on 2026-10-15. Not run end to end.

**This script:** The wrapper scripts are generated from the site data. Every .sh passed bash -n and shellcheck and ran in plan mode on Linux (Debian 13). Every .ps1 passed the PowerShell parser and chat.ps1 ran in plan, verify and rollback mode under PowerShell 7 on Linux with Windows calls mocked. Not run on macOS or real Windows.

## One command

```bash
curl -fsSL https://insidethemachine.ai/install/litellm.sh | bash
```

Windows (PowerShell):

```powershell
irm https://insidethemachine.ai/install/litellm.ps1 | iex
```

Actions: `| bash -s -- plan` (print only), `verify`, `rollback --yes`. Env: ITM_RAM. Read the script first: `curl -fsSL https://insidethemachine.ai/install/litellm.sh | less`.

Lines marked YOU RUN are not run by the script (servers, interactive apps, your own files). The script prints them at the end, in order.

## Steps

### macOS

Install:

1. **Install LiteLLM**
   - run (macOS only): `brew install uv`
   - run: `uv tool install 'litellm[proxy]'`
2. **Configure (your choices)**
   - YOU RUN (maps a local Ollama model to a proxy alias (format from LiteLLM's Ollama docs)): `cat > litellm.yaml <<'EOF'
model_list:
  - model_name: "local-llama"
    litellm_params:
      model: "ollama_chat/llama3.1"
EOF`
   - YOU RUN (proxy on http://0.0.0.0:4000): `litellm --config litellm.yaml`

Verify:

- `curl -s http://0.0.0.0:4000/chat/completions -H 'Content-Type: application/json' -d '{"model":"local-llama","messages":[{"role":"user","content":"hi"}]}'` → expect: OpenAI-format JSON response; add an Authorization header if you set a master key

Rollback:

- run: `uv tool uninstall litellm`
- run: `rm litellm.yaml`

### Linux

Install:

1. **Install LiteLLM**
   - run: `uv tool install 'litellm[proxy]'`
2. **Configure (your choices)**
   - YOU RUN (maps a local Ollama model to a proxy alias (format from LiteLLM's Ollama docs)): `cat > litellm.yaml <<'EOF'
model_list:
  - model_name: "local-llama"
    litellm_params:
      model: "ollama_chat/llama3.1"
EOF`
   - YOU RUN (proxy on http://0.0.0.0:4000): `litellm --config litellm.yaml`

Verify:

- `curl -s http://0.0.0.0:4000/chat/completions -H 'Content-Type: application/json' -d '{"model":"local-llama","messages":[{"role":"user","content":"hi"}]}'` → expect: OpenAI-format JSON response; add an Authorization header if you set a master key

Rollback:

- run: `uv tool uninstall litellm`
- run: `rm litellm.yaml`

### Windows (PowerShell, not run by us)

Install:

1. **Install LiteLLM**
   - run: `uv tool install "litellm[proxy]"`

Verify:

- by hand: `curl -s http://0.0.0.0:4000/chat/completions -H 'Content-Type: application/json' -d '{"model":"local-llama","messages":[{"role":"user","content":"hi"}]}'` → expect: OpenAI-format JSON response; add an Authorization header if you set a master key

Rollback:

- run: `uv tool uninstall litellm`
- YOU RUN (macOS/Linux command; do the same by hand): `rm litellm.yaml`
