n8n-nodes-aimedia-ai
v0.20.0
Published
Multi-provider AI Chat Model for n8n with sequential failover + retry. Any OpenAI-compatible provider (OpenAI, DeepSeek, NVIDIA, OpenRouter, Groq, ...), one credential per slot.
Downloads
1,637
Maintainers
Readme
n8n-nodes-aimedia-ai
AIMEDIA AI Chat Model — a multi-provider AI Chat Model for n8n with sequential failover + retry.
It plugs into an AI Agent like any Chat Model, but holds up to 3 provider slots. Providers are tried in order: if provider 1 errors OR returns an empty response → its retries → provider 2 → provider 3. The first non-empty response wins.
Works with any OpenAI-compatible endpoint — OpenAI, DeepSeek, NVIDIA NIM, OpenRouter, Groq, Together, Mistral, local LLMs, etc. Each slot has its own credential, so you can even use two different OpenAI accounts in slot 1 and slot 2.
This package ships two nodes:
- AIMEDIA AI Chat Model — up to 3 provider slots with sequential failover.
- AIMEDIA AI Chat Model (Single) — a single DeepSeek model (one
deepSeekApicredential, no provider selector) with a built-in retry count + retry delay (seconds). Like the classic DeepSeek community node, but robust. The Base URL comes from the credential, so you can point it atapi.deepseek.comor a DeepSeek-compatible proxy. Use this when you don't need failover, just a clean single model.
Why?
- Reliability — automatic failover across providers/keys; an empty response is treated as a failure (not silently returned).
- Robust — depends only on
@langchain/core(a peer dep n8n always ships) + rawfetchto/chat/completions. It does not bundle@langchain/openai, so it doesn't break on n8n updates the way some community model nodes do. - Observable — the node's OUTPUT panel shows
response.generations,tokenUsage, and anaimediareport (which slot answered, request count, retries, errors), and the node turns green — just like the official chat-model nodes.
Features
- ✅ Sequential failover across 1–3 providers
- ✅ Per-slot credential (independent) — e.g. 2 OpenAI keys + 1 DeepSeek
- ✅ Live model dropdown — fetched from each credential's Base URL (
/models), plus a free-text "By ID" mode - ✅ Per-slot retry count + delay
- ✅ Empty response = failure → moves to the next provider
- ✅ Thinking control — Enabled sends
thinking:{type:'enabled'}+reasoning_effort:'high'|'max'so the model reasons inreasoning_contentand makes proper tool calls (no "inner voice" leaking into the message); Disabled sends nothing (fastest) - ✅ Tool calling (AI Agent tools) supported
- ✅ Automatic DeepSeek
reasoning_contentinjection + tool-message sanitization (fixes thetool must follow tool_calls400)
Install
Settings → Community Nodes → Install → n8n-nodes-aimedia-ai
Usage
- Add AIMEDIA AI Chat Model to your AI Agent's Chat Model input.
- For each Credential at the top (Provider 1 / 2 / 3), set the API Key and Base URL (the Base URL decides the provider). Provider 1 is required; 2 and 3 are optional.
- Pick a Model for each active slot (list is fetched live from that credential's endpoint).
- Optionally set retries, delay, thinking, temperature, etc.
Slots 2 and 3 activate automatically once their credential and model are set.
Example
| Slot | Base URL | Model |
|---|---|---|
| Provider 1 | https://api.openai.com/v1 | gpt-4o-mini |
| Provider 2 | https://api.openai.com/v1 (2nd account) | gpt-4o |
| Provider 3 | https://api.deepseek.com/v1 | deepseek-chat |
License
MIT © AIMEDIA
