{"_id":"@berriai/n8n-nodes-litellm","name":"@berriai/n8n-nodes-litellm","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@berriai/n8n-nodes-litellm","version":"0.1.1","description":"n8n community node for LiteLLM - Access 100+ LLMs with unified API","license":"MIT","homepage":"https://github.com/BerriAI/n8n-nodes-litellm","keywords":["n8n-community-node-package","n8n","litellm","llm","ai","openai","anthropic","bedrock","azure"],"author":{"name":"LiteLLM","email":"krrish@berri.ai"},"repository":{"type":"git","url":"git+https://github.com/BerriAI/n8n-nodes-litellm.git"},"scripts":{"build":"n8n-node build","build:watch":"tsc --watch","dev":"n8n-node dev","lint":"n8n-node lint","lint:fix":"n8n-node lint --fix","release":"n8n-node release","prepublishOnly":"n8n-node prerelease"},"n8n":{"n8nNodesApiVersion":1,"strict":true,"credentials":["dist/credentials/LiteLLMApi.credentials.js"],"nodes":["dist/nodes/LiteLLM/LiteLlmChatModel.node.js"]},"devDependencies":{"@n8n/node-cli":"*","eslint":"9.32.0","prettier":"3.6.2","release-it":"^19.0.4","typescript":"5.9.2"},"peerDependencies":{"n8n-workflow":"*"},"publishConfig":{"access":"public"},"gitHead":"78c14c9d51ea37fe3286a3551722bbcd0933918b","_id":"@berriai/n8n-nodes-litellm@0.1.1","bugs":{"url":"https://github.com/BerriAI/n8n-nodes-litellm/issues"},"_nodeVersion":"22.17.0","_npmVersion":"11.6.4","dist":{"integrity":"sha512-xn7yGK0JWJ+BIIRAZQl0sOPyYtUoFJ/EvrI1Fzvwv9+pLtBlHxbLxE2TW7ysB5g4WB0kOh/eFSnOcrND9vUFJg==","shasum":"5933953d8e3d533006cbc584b4a092f1b8ae0b12","tarball":"https://registry.npmjs.org/@berriai/n8n-nodes-litellm/-/n8n-nodes-litellm-0.1.1.tgz","fileCount":16,"unpackedSize":74958,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHvp7U/OlSQc9EdekpBgMBuDEUi42MA6TNz7I7aM6RRQAiEA1ihc08FBS+u5NnxXtZv1mbD9UNbLnxchsOwx1llb/1c="}]},"_npmUser":{"name":"jqpro","email":"jquinter@gmail.com"},"directories":{},"maintainers":[{"name":"jqpro","email":"jquinter@gmail.com"},{"name":"krrish_dh","email":"krrish@berri.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/n8n-nodes-litellm_0.1.1_1772418598869_0.9948360717256226"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-02T02:29:58.768Z","0.1.1":"2026-03-02T02:29:59.016Z","modified":"2026-03-02T02:29:59.224Z"},"maintainers":[{"name":"jqpro","email":"jquinter@gmail.com"},{"name":"krrish_dh","email":"krrish@berri.ai"}],"description":"n8n community node for LiteLLM - Access 100+ LLMs with unified API","homepage":"https://github.com/BerriAI/n8n-nodes-litellm","keywords":["n8n-community-node-package","n8n","litellm","llm","ai","openai","anthropic","bedrock","azure"],"repository":{"type":"git","url":"git+https://github.com/BerriAI/n8n-nodes-litellm.git"},"author":{"name":"LiteLLM","email":"krrish@berri.ai"},"bugs":{"url":"https://github.com/BerriAI/n8n-nodes-litellm/issues"},"license":"MIT","readme":"# n8n-nodes-litellm\n\n[![npm version](https://badge.fury.io/js/%40litellm%2Fn8n-nodes-litellm.svg)](https://www.npmjs.com/package/@berriai/n8n-nodes-litellm)\n[![n8n](https://img.shields.io/badge/n8n-Community%20Node-00d4ff.svg)](https://n8n.io)\n\nOfficial n8n community node for [LiteLLM](https://github.com/BerriAI/litellm), providing native integration with LiteLLM proxy to access 100+ LLM providers through a unified API.\n\n[LiteLLM](https://github.com/BerriAI/litellm) is an open-source LLM proxy/gateway that provides a unified OpenAI-compatible API for 100+ LLM providers including OpenAI, Anthropic, Google, Azure, AWS Bedrock, and more. It handles load balancing, fallbacks, cost tracking, and rate limiting across all your LLM deployments.\n\n## Features\n\n- 🚀 **100+ LLM Providers** - Access OpenAI, Anthropic, Google, Azure, AWS Bedrock, and more through a single interface\n- 🔄 **Automatic Fallbacks** - Configure fallback models for reliability\n- 📊 **Built-in Observability** - Native support for Langfuse, Datadog, and custom metadata\n- 💰 **Cost Tracking** - Team-based usage tracking and analytics\n- 🎯 **Full OpenAI Compatibility** - Standard parameters (temperature, max_tokens, etc.)\n- 🔒 **Enterprise Ready** - Team management, access control, and rate limiting\n- ⚡ **Streaming Support** - Real-time response streaming (coming soon)\n\n## Installation\n\n### Via n8n Community Nodes (Recommended)\n\n1. Open your n8n instance\n2. Go to **Settings** → **Community Nodes**\n3. Search for `@berriai/n8n-nodes-litellm`\n4. Click **Install**\n\n### Manual Installation\n\n```bash\nnpm install @berriai/n8n-nodes-litellm\n```\n\nThen restart your n8n instance.\n\n## Prerequisites\n\nThis node requires a running LiteLLM proxy server. If you don't have one set up:\n\n### Quick Start with LiteLLM Proxy\n\n1. **Install LiteLLM:**\n   ```bash\n   pip install litellm[proxy]\n   ```\n\n2. **Create a config file** (`litellm_config.yaml`):\n   ```yaml\n   model_list:\n     - model_name: gpt-4o-mini\n       litellm_params:\n         model: gpt-4o-mini\n         api_key: os.environ/OPENAI_API_KEY\n\n     - model_name: claude-3-opus\n       litellm_params:\n         model: claude-3-opus-20240229\n         api_key: os.environ/ANTHROPIC_API_KEY\n   ```\n\n3. **Start the proxy:**\n   ```bash\n   litellm --config litellm_config.yaml\n   ```\n\nThe proxy will start at `http://localhost:4000` by default.\n\n📖 **Full LiteLLM documentation:** https://docs.litellm.ai/docs/proxy/quick_start\n\n## Configuration\n\n### Credentials Setup\n\n1. In n8n, create a new **LiteLLM API** credential\n2. Configure:\n   - **API Key**: Your LiteLLM proxy API key (if authentication is enabled)\n   - **Base URL**: Your LiteLLM proxy URL (default: `http://localhost:4000`)\n\n### Testing Credentials\n\nThe credential includes a built-in test that validates connectivity to your LiteLLM proxy by calling the `/v1/models` endpoint.\n\n## Usage\n\n### Basic Chat Completion\n\nThe simplest use case - send a message and get a response:\n\n```javascript\n// Node configuration\n{\n  \"model\": \"gpt-4o-mini\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explain n8n workflows in one sentence\"\n    }\n  ]\n}\n```\n\n### Multi-Message Conversation\n\nBuild conversations with system prompts and message history:\n\n```javascript\n{\n  \"model\": \"claude-3-opus\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant specializing in workflow automation.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"How do I connect to a database in n8n?\"\n    },\n    {\n      \"role\": \"assistant\",\n      \"content\": \"You can use database nodes like PostgresDB or MySQL...\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Can you show me an example?\"\n    }\n  ]\n}\n```\n\n### Advanced Configuration\n\nUse standard OpenAI parameters for fine-tuned control:\n\n```javascript\n{\n  \"model\": \"gpt-4\",\n  \"messages\": [...],\n  \"options\": {\n    \"temperature\": 0.7,\n    \"max_tokens\": 2000,\n    \"top_p\": 0.9,\n    \"frequency_penalty\": 0.5,\n    \"presence_penalty\": 0.3,\n    \"stop\": [\"END\", \"###\"]\n  }\n}\n```\n\n### LiteLLM-Specific Features\n\n#### Fallback Models\n\nAutomatically retry failed requests with fallback models:\n\n```javascript\n{\n  \"model\": \"gpt-4\",\n  \"messages\": [...],\n  \"liteLLMOptions\": {\n    \"fallbacks\": \"claude-3-opus,gpt-4o-mini\"  // Try these if primary fails\n  }\n}\n```\n\n#### Team & User Tracking\n\nTrack usage by team and user for cost allocation:\n\n```javascript\n{\n  \"model\": \"gpt-4\",\n  \"messages\": [...],\n  \"liteLLMOptions\": {\n    \"team_id\": \"engineering\",\n    \"user\": \"user@example.com\",\n    \"tags\": \"production,customer-support\"\n  }\n}\n```\n\n#### Custom Metadata for Observability\n\nSend metadata to observability platforms (Langfuse, Datadog, etc.):\n\n```javascript\n{\n  \"model\": \"gpt-4\",\n  \"messages\": [...],\n  \"liteLLMOptions\": {\n    \"metadata\": {\n      \"workflow_id\": \"workflow-123\",\n      \"customer_id\": \"cust-456\",\n      \"environment\": \"production\",\n      \"session_id\": \"sess-789\"\n    }\n  }\n}\n```\n\n## Parameters Reference\n\n### Model (Required)\n\nThe LLM model to use. Must be configured in your LiteLLM proxy config.\n\n**Examples:** `gpt-4o-mini`, `claude-3-opus`, `gemini-pro`, `llama-3-70b`\n\n### Messages (Required)\n\nArray of conversation messages. Each message requires:\n- **role**: `system`, `user`, or `assistant`\n- **content**: The message text\n\n### Options (Optional)\n\nStandard OpenAI-compatible parameters:\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `frequency_penalty` | number | 0 | Penalty for token frequency (-2.0 to 2.0) |\n| `max_tokens` | number | 1000 | Maximum tokens to generate |\n| `presence_penalty` | number | 0 | Penalty for token presence (-2.0 to 2.0) |\n| `stop` | string | - | Comma-separated stop sequences |\n| `stream` | boolean | false | Enable streaming (experimental) |\n| `temperature` | number | 0.7 | Sampling temperature (0 to 2) |\n| `top_p` | number | 1 | Nucleus sampling parameter (0 to 1) |\n\n### LiteLLM Options (Optional)\n\nLiteLLM-specific features:\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `fallbacks` | string | Comma-separated fallback models |\n| `metadata` | JSON | Custom metadata object for observability |\n| `tags` | string | Comma-separated tags for categorization |\n| `team_id` | string | Team ID for cost tracking |\n| `user` | string | User ID for analytics and rate limiting |\n\n## Response Format\n\nThe node returns the full LiteLLM/OpenAI response:\n\n```json\n{\n  \"id\": \"chatcmpl-123\",\n  \"object\": \"chat.completion\",\n  \"created\": 1677652288,\n  \"model\": \"gpt-4o-mini\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"This is the AI response...\"\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 20,\n    \"completion_tokens\": 50,\n    \"total_tokens\": 70\n  }\n}\n```\n\n**Tip:** Use the Expression `{{ $json.choices[0].message.content }}` to extract just the response text.\n\n## Compatibility\n\n- **n8n version:** 0.220.0 or higher\n- **Node.js:** 18.x or higher\n- **LiteLLM:** 1.0.0 or higher\n\n## Troubleshooting\n\n### Connection Refused\n\n**Problem:** Cannot connect to LiteLLM proxy\n\n**Solution:**\n- Verify LiteLLM proxy is running: `curl http://localhost:4000/health`\n- Check the Base URL in your credentials matches the proxy address\n- Ensure firewall allows connections to the proxy port\n\n### Authentication Failed\n\n**Problem:** 401 Unauthorized error\n\n**Solution:**\n- If your LiteLLM proxy has authentication enabled, provide the API key in credentials\n- Check the API key is valid: `curl -H \"Authorization: Bearer YOUR_KEY\" http://localhost:4000/v1/models`\n\n### Model Not Found\n\n**Problem:** Model not available error\n\n**Solution:**\n- Verify the model is configured in your `litellm_config.yaml`\n- Check model name spelling matches your config exactly\n- Restart LiteLLM proxy after config changes\n\n### Rate Limiting\n\n**Problem:** Too many requests error\n\n**Solution:**\n- Configure rate limits in LiteLLM proxy config\n- Use `user` parameter to track per-user limits\n- Implement retry logic in your workflow\n\n## Examples\n\n### Workflow Automation: Email Response Generator\n\n```\nTrigger (Webhook)\n  ↓\nLiteLLM Chat Model\n  Model: gpt-4o-mini\n  System: \"Generate professional email responses\"\n  User: \"{{ $json.email_content }}\"\n  ↓\nSend Email\n```\n\n### Multi-Provider Reliability\n\n```\nLiteLLM Chat Model\n  Model: gpt-4\n  Fallbacks: claude-3-opus,gpt-4o-mini\n  ↓\n(Automatically tries fallbacks if GPT-4 fails)\n```\n\n### Cost Tracking by Department\n\n```\nLiteLLM Chat Model\n  Model: gpt-4\n  Team ID: {{ $json.department }}\n  User: {{ $json.user_email }}\n  Tags: {{ $json.project_name }}\n  ↓\n(Track costs in LiteLLM dashboard by team/user)\n```\n\n## Resources\n\n- **LiteLLM Documentation:** https://docs.litellm.ai\n- **LiteLLM GitHub:** https://github.com/BerriAI/litellm\n- **n8n Documentation:** https://docs.n8n.io\n- **LiteLLM Discord:** https://discord.com/invite/wuPM9dRgDw\n\n## Support\n\n- **Issues:** [GitHub Issues](https://github.com/BerriAI/n8n-nodes-litellm/issues)\n- **Questions:** [n8n Community Forum](https://community.n8n.io/)\n- **LiteLLM Support:** [Discord](https://discord.com/invite/wuPM9dRgDw)\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\n[MIT License](LICENSE.md)\n\n## Maintainers\n\n**LiteLLM Team**\n- Email: krrish@berri.ai\n- GitHub: [@BerriAI](https://github.com/BerriAI)\n\n---\n\nBuilt with ❤️ by the LiteLLM team\n","readmeFilename":"README.md","_rev":"1-a5b628ef71090c8b8fc6c6478865bc29"}