Call 100+ LLM providers through LiteLLM's unified API. Use when you need to call a different model than your primary (e.g., use GPT-4 for code review while running on Claude), compare outputs from multiple models, route to cheaper models for simple tasks, or access models your runtime doesn't natively support.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install litellm或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install litellm⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/litellm/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: litellm description: Call 100+ LLM providers through LiteLLM's unified API. Use when you need to call a different model than your primary (e.g., use GPT-4 for code review while running on Claude), compare outputs from multiple models, route to cheaper models for simple tasks, or access models your runtime doesn't natively support. ---
Use LiteLLM when you need to call LLMs beyond your primary model.
import litellm
# Call any model with unified API
response = litellm.completion(
model="gpt-4o",
messages=[{"role": "user", "content": "Explain this code"}]
)
print(response.choices[0].message.content)
import litellm
prompt = [{"role": "user", "content": "What's the best approach to X?"}]
models = ["gpt-4o", "claude-sonnet-4-20250514", "gemini/gemini-1.5-pro"]
for model in models:
resp = litellm.completion(model=model, messages=prompt)
print(f"{model}: {resp.choices[0].message.content[:200]}...")
import litellm
def smart_call(task_type: str, prompt: str) -> str:
model_map = {
"code": "gpt-4o", # Strong at code
"writing": "claude-sonnet-4-20250514", # Strong at prose
"simple": "gpt-4o-mini", # Cheap for simple tasks
"reasoning": "o1-preview", # Deep reasoning
}
model = model_map.get(task_type, "gpt-4o")
resp = litellm.completion(
model=model,
messages=[{"role": "user", "content": prompt}]
)
return resp.choices[0].message.content
If a LiteLLM proxy is available, point to it for caching, rate limiting, and observability:
import litellm
litellm.api_base = "https://your-litellm-proxy.com"
litellm.api_key = "sk-your-key"
response = litellm.completion(
model="gpt-4o", # Proxy routes to configured provider
messages=[{"role": "user", "content": "Hello"}]
)
Ensure litellm is installed and API keys are set:
pip install litellm
# Set provider keys (or configure in proxy)
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-..."
Common model identifiers:
gpt-4o, gpt-4o-mini, o1-preview, o1-miniclaude-sonnet-4-20250514, claude-opus-4-20250514gemini/gemini-1.5-pro, gemini/gemini-1.5-flashmistral/mistral-large-latestFull list: https://docs.litellm.ai/docs/providers
安装 LiteLLM 后,可以对 AI 说这些话来触发它
Help me get started with LiteLLM
Explains what LiteLLM does, walks through the setup, and runs a quick demo based on your current project
Use LiteLLM to call 100+ LLM providers through LiteLLM's unified API
Invokes LiteLLM with the right parameters and returns the result directly in the conversation
What can I do with LiteLLM in my developer & devops workflow?
Lists the top use cases for LiteLLM, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/litellm/ 目录(个人级,所有项目可用),或 .claude/skills/litellm/(项目级)。重启 AI 客户端后,用 /litellm 主动调用,或让 AI 根据上下文自动发现并使用。
LiteLLM 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
LiteLLM 可免费安装使用。请查阅仓库了解许可证信息。
Call 100+ LLM providers through LiteLLM's unified API. Use when you need to call a different model than your primary (e.g., use GPT-4 for code review while running on Claude), compare outputs from multiple models, route to cheaper models for simple tasks, or access models your runtime doesn't natively support.
LiteLLM 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using LiteLLM
Identifies repetitive steps in your workflow and sets up LiteLLM to handle them automatically