Skip to content

feat(ai): add Eden AI as a provider#1031

Open
MVS-source wants to merge 2 commits into
crynta:mainfrom
MVS-source:feat/edenai-provider
Open

feat(ai): add Eden AI as a provider#1031
MVS-source wants to merge 2 commits into
crynta:mainfrom
MVS-source:feat/edenai-provider

Conversation

@MVS-source

@MVS-source MVS-source commented Jul 21, 2026

Copy link
Copy Markdown

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 createOpenAICompatible path with base URL https://api.edenai.run/v3 and EDENAI_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:

  • EU data residency: a dedicated EU endpoint (https://api.eu.edenai.run/v3) that processes and routes prompts and outputs within the European Union (non-EU models are rejected).
  • Zero data retention: prompts and outputs are not stored by default and are removed within 24 hours.
  • Compliance: SOC 2 and ISO 27001, DPA as standard, designed around GDPR and the EU AI Act.

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: edenai in the ProviderId union, a PROVIDERS entry (keyring account edenai-api-key), and a configurable model entry.
  • src/modules/ai/lib/agent.ts: a buildLanguageModel branch (createOpenAICompatible, base URL https://api.edenai.run/v3).
  • src/modules/ai/lib/keyring.ts and the provider-icon maps (AiStatusBarControls.tsx, ProviderIcon.tsx): the new edenai entry.

Testing

  • tsc --noEmit is clean.
  • vitest run on config.test.ts and agents.test.ts passes (46 tests).
  • Live: verified against the real Eden AI API with a real key, using the exact buildLanguageModel path (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

  • New Features
    • Added Eden AI as a supported AI provider.
    • Added an Eden AI custom model option with selectable capabilities.
    • Enabled Eden AI provider/API key configuration and model resolution.
    • Added Eden AI icon support across provider-related interfaces.

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.
@MVS-source
MVS-source requested a review from crynta as a code owner July 21, 2026 15:01
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a1141076-0159-412f-9b97-ef18bd313a7a

📥 Commits

Reviewing files that changed from the base of the PR and between cc7408b and 6afc013.

📒 Files selected for processing (1)
  • src/modules/ai/config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/modules/ai/config.ts

📝 Walkthrough

Walkthrough

Eden AI is registered as an AI provider, added to the model catalog and key defaults, supported by runtime model construction, and assigned GlobeIcon in provider-related UI.

Changes

Eden AI integration

Layer / File(s) Summary
Provider catalog and key registration
src/modules/ai/config.ts, src/modules/ai/lib/keyring.ts
Adds the edenai provider ID, provider metadata, edenai-custom model entry, and default API-key slot.
Eden AI model construction
src/modules/ai/lib/agent.ts
Builds an OpenAI-compatible Eden AI model using the v3 base URL and configured API key.
Provider icon rendering
src/modules/ai/components/AiStatusBarControls.tsx, src/settings/components/ProviderIcon.tsx
Maps Eden AI to GlobeIcon in status-bar and settings provider icon mappings.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the Eden AI provider addition.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fd99bf6 and cc7408b.

📒 Files selected for processing (5)
  • src/modules/ai/components/AiStatusBarControls.tsx
  • src/modules/ai/config.ts
  • src/modules/ai/lib/agent.ts
  • src/modules/ai/lib/keyring.ts
  • src/settings/components/ProviderIcon.tsx

Comment on lines +164 to +173
case "edenai": {
const { createOpenAICompatible } =
await import("@ai-sdk/openai-compatible");
built = createOpenAICompatible({
name: "edenai",
baseURL: "https://api.edenai.run/v3",
apiKey: key,
})(resolvedModelId);
break;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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.ts

Repository: 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant