@frierensz_/n8n-nodes-litellm
v0.1.10
Published
n8n community node for LiteLLM (OpenAI-compatible proxy) with dynamic model list and automatic DeepSeek reasoning support
Maintainers
Readme
@frierensz_/n8n-nodes-litellm
Community node for LiteLLM (OpenAI-compatible proxy) in n8n.
The Model field is populated live from your LiteLLM proxy's own /models list — no
hardcoded model names. If the selected model is a DeepSeek model, the node automatically
handles DeepSeek's reasoning quirk: the reasoning_content (thinking) that DeepSeek's thinking
mode requires to be echoed back is round-tripped for you, instead of causing a 400 loop like it
does with generic OpenAI-compatible nodes. Any other model behind the proxy behaves as a normal
OpenAI-compatible chat model.
Nodes
- LiteLLM — action node. See the actions below.
- LiteLLM Chat Model — sub-node for the AI Agent. Plug it into an Agent to use any model behind your LiteLLM proxy as the reasoning brain, with tool calling.
- LiteLLM Embeddings — sub-node for vector stores (Qdrant, PGVector, Pinecone, ...). Set
Dimensions to control the output vector size: LiteLLM maps it to Gemini's
outputDimensionalityand Vertex'soutput_dimensionality, sogemini-embedding-001at 768 works the same waytext-embedding-3-largeat 1024 does. Leave it unset for models that don't support resizing.
Actions
| Resource | Action | Endpoint |
|----------|--------|----------|
| Text | Message a model | /chat/completions |
| Image | Analyze an image | /chat/completions (image_url) |
| Image | Generate an image | /images/generations |
| Audio | Analyze audio | /chat/completions (input_audio) |
| Audio | Transcribe a recording | /audio/transcriptions |
| Document | Analyze a document | /chat/completions (file) |
| Video | Analyze a video | /chat/completions (video_url) |
| Video | Generate a video | /videos |
The analyze actions take either a binary field from a previous node (default data) or a
URL. Whether a given model can actually read an image/audio/video/PDF depends on the model you
route to in LiteLLM — Gemini and GPT-4o handle all of them, most text-only models handle none.
Chat actions split content, reasoning_content and tool_calls in the output, and support tools
(function calling) and JSON mode.
Generating video takes minutes — LiteLLM returns a job ID and the node polls until it is done,
then hands you the mp4 as a binary field. Raise Max Wait (Minutes) (default 10) if your model
needs longer. Works with sora-2 (OpenAI) and veo-3 (Gemini).
Note on transcription: Transcribe a Recording uses the Whisper-style /audio/transcriptions
endpoint, which only a few providers implement (OpenAI, Azure, Groq, Deepgram, Fireworks). Gemini
has no such endpoint — to transcribe with Gemini, use Analyze Audio and ask for a transcript in
the prompt.
Not available: File Search stores — that is a Gemini-specific API with no OpenAI-compatible equivalent on the proxy.
Model list
The Model dropdown is loaded from your proxy's /models.
The two sub-nodes will filter it by kind — Chat Model shows chat models, Embeddings shows embedding
models — if your key can read /model_group/info or /model/info, where LiteLLM reports each
model's mode.
Most keys cannot. Those are admin routes: a virtual key scoped to
llm_api_routes(the right way to key n8n) gets back403 Virtual key is not allowed to call this route. When that happens the node simply lists every model, exactly as if there were no filter — it never fails. Filtering is a convenience, not a requirement, and it is not worth widening your key's permissions for.
Two more things worth knowing when filtering is active:
- LiteLLM only knows the mode of models in its cost map, so custom aliases and self-hosted models
report
mode: null. Those are kept, never hidden. - Show All Models turns the filter off for that node.
The LiteLLM action node is never filtered, since the right kind depends on the action you picked.
Transcribing non-English audio with Deepgram
If you send Portuguese (or any non-English) audio to deepgram/nova-2 or nova-3 through LiteLLM,
you get HTTP 200 with an empty text. Nothing is broken on your side: LiteLLM never forwards
the language parameter to Deepgram, so Deepgram falls back to English and returns nothing.
This is a LiteLLM bug, not a node or a credential problem. Two filters in
litellm/llms/deepgram/audio_transcription/transformation.py cancel each other out:
map_openai_paramscopies only the params inget_supported_openai_params()— which is exactly["language"].get_provider_specific_paramsthen builds the Deepgram query string while excluding those same supported params.
Net result: the query string LiteLLM sends to Deepgram carries model and nothing else. No
setting, header, query string, extra_body, or litellm_params entry changes it —
issue #14076 was closed as not planned.
The fix: put the query string in api_base
Register a second model whose api_base already contains the Deepgram parameters. LiteLLM appends
/listen?model=... to whatever api_base you give it, so end the value with a throwaway
parameter (&ignore=) to absorb that suffix:
curl -X POST "https://YOUR-LITELLM/model/new" -H "Authorization: Bearer YOUR_LITELLM_ADMIN_KEY" -H "Content-Type: application/json" -d '{
"model_name": "deepgram/nova-3-PT-BR",
"litellm_params": {
"model": "deepgram/nova-3",
"litellm_credential_name": "Deepgram",
"api_base": "https://api.deepgram.com/v1/listen?model=nova-3&language=pt-BR&smart_format=true&punctuate=true&ignore="
},
"model_info": { "mode": "audio_transcription", "input_cost_per_second": 0.00007167 }
}'Swap litellm_credential_name for "api_key": "YOUR_DEEPGRAM_KEY" if you have not stored the
credential in LiteLLM. Add any other Deepgram flag to the same query string — diarize=true,
utterances=true, numerals=true — they all arrive intact.
Why this beats patching LiteLLM: it survives docker pull, since it is a row in the database and
not an edited file. Cost tracking keeps working, because the request still goes through LiteLLM's
own /audio/transcriptions.
Two things to expect: the response's language field still reports en — it was hardcoded until
PR #16093 — and the model must be registered once
per language, since the language is baked into the URL.
Prompt for an AI assistant
Paste this into Claude Code (or any assistant with shell access) to have it done for you:
My LiteLLM proxy transcribes English fine with Deepgram but returns an empty
`text` for Portuguese audio. The cause is a known LiteLLM bug: it never forwards
the `language` parameter to Deepgram, so no amount of configuration on the
request side fixes it.
Work around it by registering a new model whose api_base already carries the
Deepgram query string, ending in a throwaway `&ignore=` parameter (LiteLLM
appends `/listen?model=...` to api_base, and `ignore=` absorbs that suffix):
POST https://MY-LITELLM/model/new
Authorization: Bearer MY_ADMIN_KEY
{
"model_name": "deepgram/nova-3-PT-BR",
"litellm_params": {
"model": "deepgram/nova-3",
"litellm_credential_name": "Deepgram",
"api_base": "https://api.deepgram.com/v1/listen?model=nova-3&language=pt-BR&smart_format=true&punctuate=true&ignore="
},
"model_info": { "mode": "audio_transcription", "input_cost_per_second": 0.00007167 }
}
Then verify by transcribing a Portuguese audio file through
POST /audio/transcriptions with model=deepgram/nova-3-PT-BR. A non-empty `text`
with punctuation means it worked. Do not edit any LiteLLM source file, and do
not touch my existing model registrations.Install
In n8n: Settings → Community Nodes → Install → @frierensz_/n8n-nodes-litellm.
Credentials
Create a LiteLLM API credential with your proxy's master key (or a virtual key) and its base
URL (e.g. http://localhost:4000).
Reasoning (DeepSeek)
Turn on Reasoning (Thinking Mode) in Options. It only takes effect when the selected model
name contains deepseek (e.g. deepseek-v4-pro, or whatever alias you gave it in LiteLLM) — for
any other model the toggle is ignored so non-DeepSeek requests aren't broken by DeepSeek-only
params.
Develop
npm install
npm run build
npm test # asserts the multimodal content-part shapesPoint n8n at the built package with N8N_CUSTOM_EXTENSIONS=/path/to/n8n-nodes-litellm, or
npm link it into ~/.n8n/custom.
License
MIT
