LiteLLM Proxy
LiteLLM Proxy 是 osFoundry 社区目录中的应用。面向开发者的 LLM 网关。单一 OpenAI 兼容 /chat/completions 端点,可转译到 100+ 厂商 API(OpenAI、Anthropic、Azure、Bedrock、Vertex、Cohere、Together、Replicate、Ollama、vLLM……),具备自动重试、回退、限流处理、密钥轮转、按虚拟密钥的支出跟踪,并支持 OpenAI Realtime API。是 GitHub 上 star 数最高的 LLM 代理,与 one-api 的 UI 优先路线相比,它是 SDK 优先的。
详情
- 工作区: osfoundry
- 分类: AI
- 价格: Free
- 访问权限: Community
功能
- Single OpenAI-compatible endpoint that calls 100+ providers (Anthropic, Bedrock, Vertex, Azure, Ollama, ...)
- Virtual keys with per-key budgets + rate limits + model restrictions + expiry
- Automatic fallbacks — 'use claude-3-5 if gpt-4o is down or over quota' as one-line config
- Spend tracking per-key, per-model, per-team — export to CSV + Prometheus
- OpenAI Realtime API support — voice/audio mode passthrough
- SQLite default — zero infrastructure for solo + small-team use; Postgres optional
文档
文档由上游项目以英文维护。
# LiteLLM Proxy
## First-boot
Set `LITELLM_MASTER_KEY` + `LITELLM_SALT_KEY` + `UI_PASSWORD` env. Restart — admin UI lives at `/ui`.
## Add models
Log into `/ui` → **Models** → **+ Add** — each model maps a 'public model name' (what clients see, e.g. `gpt-4o`) to an upstream:
- OpenAI: pick OpenAI, paste key, pick model id
- Anthropic: pick Anthropic, paste key, pick claude-3-5-sonnet-20241022
- Bedrock / Vertex / Azure: paste the provider-specific creds
- Ollama: pick ollama, set api_base to your Ollama URL
## Generate virtual keys
**Keys** tab → **+ Create** — issue per-team or per-app keys with:
- Spend budget (per day / month / total)
- Model restrictions (only certain models accessible)
- Rate limits (RPM, TPM)
- Expiry date
Give the `sk-...` key to your downstream app:
```python
from openai import OpenAI
client = OpenAI(base_url='https://<your-public-url>', api_key='sk-...')
client.chat.completions.create(model='gpt-4o', messages=[...])
```
LiteLLM looks up the model, calls the upstream, tracks spend, enforces budgets.
## Fallbacks + retries
In Model config: set `fallbacks: [{ model: 'gpt-4o', fallbacks: ['claude-3-5-sonnet', 'gemini-1.5-pro'] }]` — if gpt-4o is down or over quota, requests auto-route to Claude, then Gemini.
## Spend tracking
Usage tab shows per-key, per-model, per-team spend in $. Export to CSV / Prometheus. Tags on each request let you slice by user/app/feature.
## Storage
SQLite at `/data/litellm.db` for keys + spend log. For multi-instance scale, switch to Postgres via `DATABASE_URL` env.
如何在 osFoundry 中使用 LiteLLM Proxy
一键将 LiteLLM Proxy 安装到您的工作区,然后在 osStudio 中将其分支,针对您的技术栈自定义提示词、工具或配置。工作区中的任何人都可以接续您的工作继续推进。
社区中的其他应用
- 客户关系管理 — 客户关系管理工具,支持联系人、交易和销售管道跟踪。
- Kanban Board — Trello 风格的看板与项目板,含卡片、面板、日历与表格视图以及每面板属性。基于 Focalboard(独立个人服务器)构建。在持久卷上内嵌 SQLite。
- 服务台 — 工单分流与客户支持收件箱,附带 SLA 跟踪。
- Page Builder — 可视化拖放页面生成器,支持区块、主题、SEO 与发布
- Website Builder — 带 CMS 合集、全局导航、页脚、主题与发布的多页面网站生成器
- 店面 — 电商店面,包含商品目录、购物车和结账流程。