Adapter exposing LiteLLM models to the Vercel AI SDK, defining rate limits, capabilities and model metadata for LLM integration.
// Source: https://github.com/lemony-ai/cascadeflow | License: MIT | Copyright 2025 Lemony Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { createProviderAdapter } from './base';
export const liteLLMAdapter = createProviderAdapter({
id: 'litellm',
label: 'LiteLLM',
envKeys: ['LITELLM_API_KEY'],
defaultBaseUrl: 'https://api.litellm.ai/v1',
rateLimit: {
requestsPerMinute: 120,
tokensPerMinute: 150000,
concurrency: 15,
},
capabilities: {
streaming: true,
tools: true,
},
models: [
{
id: 'openai/gpt-4o-mini',
label: 'OpenAI GPT-4o Mini (via LiteLLM)',
cost: { input: 0.00015, output: 0.0006 },
contextWindow: 128000,
supportsTools: true,
},
{
id: 'anthropic/claude-3-5-sonnet-2024102
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key