feat(ai): add Eden AI as a provider#1031
Conversation
Eden AI is a French, EU-based OpenAI-compatible gateway. It is wired like the existing OpenRouter/Mistral providers: a PROVIDERS entry (EDENAI_API_KEY, keyring account edenai-api-key), a buildLanguageModel branch using createOpenAICompatible with base URL https://api.edenai.run/v3, and a configurable model entry (vendor-prefixed ids, e.g. openai/gpt-4o-mini). The ProviderId union and the provider icon/keys maps are updated accordingly. Eden AI also offers an EU data-residency endpoint (https://api.eu.edenai.run/v3) with zero data retention, useful for GDPR-sensitive setups.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughEden AI is registered as an AI provider, added to the model catalog and key defaults, supported by runtime model construction, and assigned ChangesEden AI integration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/modules/ai/lib/agent.ts`:
- Around line 164-173: Add a focused mocked regression test for the "edenai"
branch in the agent model-building flow, asserting that createOpenAICompatible
receives the Eden AI base URL and API key and that the resulting provider is
invoked with resolvedModelId. Keep the test isolated from real network or
provider calls.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e5d5003a-a381-400a-a043-f2f3b21a4d88
📒 Files selected for processing (5)
src/modules/ai/components/AiStatusBarControls.tsxsrc/modules/ai/config.tssrc/modules/ai/lib/agent.tssrc/modules/ai/lib/keyring.tssrc/settings/components/ProviderIcon.tsx
| case "edenai": { | ||
| const { createOpenAICompatible } = | ||
| await import("@ai-sdk/openai-compatible"); | ||
| built = createOpenAICompatible({ | ||
| name: "edenai", | ||
| baseURL: "https://api.edenai.run/v3", | ||
| apiKey: key, | ||
| })(resolvedModelId); | ||
| break; | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the implementation around the Eden AI branch and nearby provider handling.
ast-grep outline src/modules/ai/lib/agent.ts --view expanded || true
sed -n '1,260p' src/modules/ai/lib/agent.ts
# Find existing tests that cover buildLanguageModel or provider construction.
rg -n "buildLanguageModel|edenai|createOpenAICompatible|baseURL|resolvedModelId" src test . --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**'
# List likely test files under the AI module.
git ls-files 'src/modules/ai/**/*test*' 'src/modules/ai/**/*spec*' 'src/**/*test*' 'src/**/*spec*'Repository: crynta/terax-ai
Length of output: 24838
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Look for indirect coverage of buildLanguageModel through AI module tests.
rg -n "buildLanguageModel\(|buildConfiguredLanguageModel\(|runAgentStream\(|createOpenAICompatible\(|edenai" src --glob '*test.ts' --glob '*test.tsx' --glob '*spec.ts' --glob '*spec.tsx'
# Inspect the AI module test file list to confirm what is covered today.
git ls-files 'src/modules/ai/**/*test.ts' 'src/modules/ai/**/*test.tsx' 'src/modules/ai/**/*spec.ts' 'src/modules/ai/**/*spec.tsx'
# Read the config tests only if they touch provider model wiring.
sed -n '1,260p' src/modules/ai/config.test.tsRepository: crynta/terax-ai
Length of output: 153
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# List AI module test files.
git ls-files 'src/modules/ai/**/*test.ts' 'src/modules/ai/**/*test.tsx' 'src/modules/ai/**/*spec.ts' 'src/modules/ai/**/*spec.tsx'
# Inspect the config test for any provider-construction coverage.
sed -n '1,260p' src/modules/ai/config.test.ts
# Search for buildLanguageModel coverage outside the AI module.
rg -n "buildLanguageModel\(|createOpenAICompatible\(|edenai" src --glob '*test.ts' --glob '*test.tsx' --glob '*spec.ts' --glob '*spec.tsx'Repository: crynta/terax-ai
Length of output: 6115
Add a regression test for the Eden AI branch
src/modules/ai/lib/agent.ts:164-173 should have a focused mocked test that locks the Eden AI base URL, API key, and resolved model ID passed into createOpenAICompatible.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/modules/ai/lib/agent.ts` around lines 164 - 173, Add a focused mocked
regression test for the "edenai" branch in the agent model-building flow,
asserting that createOpenAICompatible receives the Eden AI base URL and API key
and that the resulting provider is invoked with resolvedModelId. Keep the test
isolated from real network or provider calls.
Source: Coding guidelines
The /v2/settings/api path is no longer valid; use the current Eden AI API-settings page for key management.
What
Adds Eden AI as a provider, wired the same way as the existing OpenRouter and Mistral providers.
Eden AI is a French, EU-based OpenAI-compatible gateway. It reuses the
createOpenAICompatiblepath with base URLhttps://api.edenai.run/v3andEDENAI_API_KEY. Model ids are vendor-prefixed, e.g.openai/gpt-4o-mini,anthropic/claude-sonnet-4-5,mistral/mistral-small-latest.Why Eden AI (EU / GDPR / data residency)
For terax-ai users with European data-protection requirements, Eden AI provides:
https://api.eu.edenai.run/v3) that processes and routes prompts and outputs within the European Union (non-EU models are rejected).One OpenAI-compatible key reaches many upstream vendors while keeping data in the EU. Refs: https://www.edenai.co/post/eu-ai-endpoint-how-to-keep-ai-requests-and-data-in-europe and https://www.edenai.co/data-compliancy
Changes
src/modules/ai/config.ts:edenaiin theProviderIdunion, aPROVIDERSentry (keyring accountedenai-api-key), and a configurable model entry.src/modules/ai/lib/agent.ts: abuildLanguageModelbranch (createOpenAICompatible, base URLhttps://api.edenai.run/v3).src/modules/ai/lib/keyring.tsand the provider-icon maps (AiStatusBarControls.tsx,ProviderIcon.tsx): the newedenaientry.Testing
tsc --noEmitis clean.vitest runonconfig.test.tsandagents.test.tspasses (46 tests).buildLanguageModelpath (createOpenAICompatible({ name: "edenai", baseURL: "https://api.edenai.run/v3", apiKey })). Three vendors returned completions:anthropic/claude-sonnet-4-5,openai/gpt-4o-mini,mistral/mistral-small-latest.I saw that CONTRIBUTING asks to discuss new AI providers first, so I'm very happy to convert this into an issue/discussion if you prefer, or to adjust anything here.
Summary by CodeRabbit