تخطَّ إلى المحتوى
TakoAPI
العودة إلى المهارات

litellm

بواسطة ishaan-jaff

Coding Agents & IDEs
1.3kالتنزيلات وفق ما يذكره clawskills.sh
1النجوم
0المشاهدات
لا إعجاباتسجّل الدخول للإعجاب بهذه المهارة
—لم يُقيَّم بعد
تقييمك

موجز

Call 100+ LLM providers through LiteLLM's unified API.

الوصف

ما الذي تفعله هذه المهارة

LiteLLM provides a unified Python API to call 100+ LLM providers using the same interface. It handles routing, so you can switch between OpenAI, Anthropic, Google, and others without rewriting call logic. A proxy mode adds caching, rate limiting, and observability on top.

Instead of maintaining separate SDK integrations for each provider, one call signature works across all of them.

متى تستخدمها

  • Route code review tasks to GPT-4o while running on Claude
  • Compare outputs from three models on the same prompt
  • Switch to gpt-4o-mini for simple classification to cut costs
  • Access Gemini or Mistral from a runtime that only supports OpenAI format
  • Point all LLM calls through a shared proxy for usage tracking

مثال على سير العمل

الإدخال

User asks: compare how GPT-4o and Claude answer 'What is the best sorting algorithm?'

الوكيل
  1. 1

    Import litellm and define the prompt as a messages list

  2. 2

    Loop over ["gpt-4o", "claude-sonnet-4-20250514"]

  3. 3

    Call litellm.completion(model=model, messages=prompt) for each

  4. 4

    Extract response.choices[0].message.content from each result

  5. 5

    Print each model name alongside its response

الإخراج

Side-by-side text outputs from GPT-4o and Claude for the same question

المتطلبات

  • OPENAI_API_KEY environment variable (for OpenAI models)
  • ANTHROPIC_API_KEY environment variable (for Anthropic models)

التثبيت

clawhub install ishaan-jaff/litellm

شغّل أمر واجهة سطر الأوامر، أو الصق النص في Claude Code أو Cursor أو Codex أو أي وكيل برمجة تستخدمه.

الروابط