Repository navigation
feat: add Eden AI as a first-class LLM provider and embedder - #705
Conversation
|
✅ Health of changed files: 3.5 → 4.3 (+0.8) 📋 At a glance Files & modules (2)
📌 Before you merge
🔎 More signals (4)🗺️ Change map flowchart LR
subgraph PR ["Changed in this PR (4 modules)"]
m_packages_cli["packages/cli (3 files)"]:::changed
m_packages_core["packages/core (3 files)"]:::changed
m_packages_server["packages/server (2 files)"]:::changed
m_packages_web["packages/web (1 file)"]:::changed
end
d_packages_core["packages/core"]
m_packages_server -->|2 files| d_packages_core
d_packages_server["packages/server"]
m_packages_core -->|1 file| d_packages_server
d_packages_core["packages/core"]
m_packages_web -->|1 file| d_packages_core
classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Solid arrows: code that imports the changed files (105 direct dependents, from the last indexed snapshot). Dashed: history/tests. 🔥 Hotspots touched (5)
2 more
🔗 Hidden coupling (1 file)
💀 Dead code (8 findings)
5 more
👀 Suggested reviewers @RaghavChamadiya 📊 See the full report for this PR |
87f5117 to
d78db8b
Compare
|
Thanks @MVS-source, and apologies that this has had no real review at all in the time it has been open. That is on us, not on you. The proposal in #704 is well scoped: an OpenAI-compatible gateway with an EU option, no new dependency. That is the easy kind of provider to say yes to. The branch needs a rebase before a content review is worth doing. You opened this on 7 July, and the Kimi provider landed on 14 July touching For reference, the current contract for adding a provider is a module under
|
d78db8b to
d7da8c5
Compare
|
Rebased onto Two notes on the rebase, in case they are useful beyond this PR. The four files you expected to conflict ( While re-checking against the contract in One functional defect, now fixed. The embedder defaulted to a US-region model, which is a poor look for a gateway whose reason to exist here is an EU endpoint. I measured every candidate against Eden AI's Worth flagging for reviewers: Eden AI returns The adapter had also drifted from Two docs observations. Verification on the rebased branch:
Disclosure: I work at Eden AI, so this is a vendor contributing its own provider. This change was AI-assisted; I reviewed the diff myself and every model id, dimension count and price in it was verified against the live API rather than assumed. |
|
Thanks @MVS-source. This is a better-argued rebase than most first reviews I write, and the disclosure at the bottom is the right way to contribute a vendor's own provider. Taking the decision first, since you have earned a straight answer: yes, we want this. But the reason is the EU endpoint, not the model count. Which is also why I would rather the docs led on that. One thing to change before I merge. The diff inserts "anthropic",
"openai",
"openrouter",
+ "edenai",
"ollama",
"gemini",That changes resolution for people who are not asking for it. Anyone who has I do not think this was deliberate, the rest of the diff is scrupulous about not privileging Eden AI, which is exactly why the one place it does stands out. Two smaller things, neither blocking: The You are right about both On the ruff note: yes, CI needed maintainer approval since this is a fork, I have approved it and the full matrix is running now. Push the autodetect change and I will merge on green. |
|
You are right, and thank you for catching it. Pushed in 6ba72bc. The autodetect position was not deliberate, but I should still have caught it: I read that tuple while auditing the diff against the contract and recorded it as "consistent with the existing order" rather than asking why a new provider was sitting ahead of four incumbents. Your framing, that autodetect order is de facto precedence and the failure mode is a charge on the wrong account rather than an error, is the part I missed.
Verified the scenario you described. With On the doc copies: there were three of that chain rather than two. I took the docs point too. The Left alone as you asked: the two One thing worth flagging so it does not look like my mess: |
Eden AI (https://www.edenai.co/) is an EU-headquartered gateway exposing 700+ models (Mistral, GPT, Claude, Gemini, Cohere, DeepSeek, Llama, ...) behind a single OpenAI-compatible endpoint. Because it is OpenAI-compatible, this reuses the existing `openai` dependency with a custom base_url — no new dependency. - llm/edenai.py: EdenAIProvider (generate + streaming chat + /models discovery), default mistral/mistral-small-latest, EDENAI_API_KEY, EDENAI_BASE_URL override (EU endpoint https://api.eu.edenai.run/v3 for data residency). reasoning maps to OpenAI reasoning_effort for OpenAI reasoning models routed via Eden. - embedding/edenai.py: EdenAIEmbedder (openai/text-embedding-3-small default, 1536/3072/1024 dims for the supported models). - Registered in the LLM and embedding registries, rate limiter defaults, server provider catalog, CLI provider selection / resolution / validation, embedder auto-detection, and the web settings UI. - Unit tests for the provider and embedder (mocked; no network). - Docs: CONFIG.md provider + embedder + env-var entries, .env.example. The API key is read only from EDENAI_API_KEY (or passed explicitly); it is never logged or hardcoded. Signed-off-by: MVS-source <[email protected]>
The embedder shipped three US-region models and defaulted to one of them, which contradicts the reason to reach for this gateway. Widths were also taken from the upstream vendors rather than measured through Eden AI, and one entry was never served at all. Measured every candidate against Eden AI's /v3/embeddings endpoint and rebuilt _DIMS from the results. Notably Eden AI returns google/gemini-embedding-001 at its full 3072 width where OpenRouterEmbedder._DIMS records 768 for the same id, so a comment marks the two tables as independent rather than out of sync. The default is now amazon/amazon.titan-embed-text-v2:0: EU region, 1024 dims, and the cheapest per token of the declared set. Also brings the adapter up to the OpenRouterEmbedder contract it had drifted from: resolve_embedding_timeout so EDENAI_EMBEDDING_TIMEOUT and the shared REPOWISE_EMBEDDING_TIMEOUT are honoured like every other embedder, a dimensions override, and a post-response width guard that fails loudly instead of storing mis-sized vectors. Registers edenai in the two _EMBEDDER_KEY_ENV maps. Without them a key persisted to .repowise/.env never reached the embedder, so only an exported variable worked. Updates the two provider tables that enumerate builtins, and the provider and embedder lists across the docs.
Autodetect order is de facto precedence, so a provider adding itself must not place itself ahead of providers a user is already resolving to. An unrelated EDENAI_API_KEY in the environment moved someone from Gemini or DeepSeek to Eden AI on their next run, and the failure mode was a charge on the wrong account rather than an error. Moves edenai to the end of PROVIDER_AUTODETECT_ORDER and applies the same to the embedder detection, which had the same problem. Updates the three doc copies of the key precedence chain, including website/configuration.md which was missing the entry entirely, and the provider and embedder lists that mirror that order. Also flips the CONFIG.md section to lead on the EU endpoint rather than the catalogue size, since residency is the gap this closes.
6ba72bc to
3cbcc1b
Compare
|
Rebased onto current The three failures were in Verified locally after the rebase: Separately: I said earlier that two |
RaghavChamadiya
left a comment
There was a problem hiding this comment.
Appending edenai rather than slotting it in is exactly it, and the comment you left on the tuple says why better than the review did:
# A provider adding itself appends: autodetect order is de facto precedence,
# and an unrelated EDENAI_API_KEY in the environment must not silently take
# over from a provider the user was already resolving to.That is the rule for the next provider too, written where the next person will read it.
Full matrix green on 3cbcc1b, all three Python versions plus ruff. Thanks for staying with this one, it has been open a long time.
Two things we still owe you from the earlier discussion, both ours and neither blocking: CONTRIBUTING.md step 4 still names run-config-form.tsx, which no longer exists, and the ruff>=0.6,<1 pin lets a fresh uv sync pull 0.15, whose formatter rewrites hundreds of files. Those are on our list, not yours.
…test Merge from main added edenai (PR repowise-dev#705) after this branch was created — registry _BUILTIN_PROVIDERS must contain both edenai and azure_openai, not replace one with the other. Restore edenai entries in _BUILTIN_PROVIDERS, PROVIDER_API_KEY/BASE_URL maps (was deleted via merge), and add azure_openai to the deliberate-budget test expected set (60s, same as openai). Fixes CI failures: test_every_builtin_provider_has_a_deliberate_budget and provider env registry autodetect tests.
) edenai was registered as an embedder and documented in CLI_REFERENCE.md and CONFIG.md by #705, but four lists were left on the older five-backend set: - init --embedder and reindex --embedder click.Choice rejected the value - neither interactive prompt offered it (_prompt_generation and _prompt_index_only_search) - _resolve_embedder_from_env never read EDENAI_API_KEY, so a machine whose only key is that one defaulted to the mock and semantic search ran on vectors that cannot match the index - server _build_embedder stopped at openrouter and fell through to KeylessEmbedder with only a warning, reporting healthy meanwhile (#306) EDENAI_API_KEY is read last, before the mock, mirroring the shared resolver in cli/providers/embedders.py so an unrelated key cannot outrank a backend the user was already resolving to. The reindex flag was spotted by @sloemo01 in #1819. Fixes #1815
* docs: add Plano, Repowise and PyGPT integration guides The last three merged Eden AI integrations without a page here. Plano katanemo/plano#1002 2026-07-29 AI Gateway Repowise repowise-dev/repowise#705 2026-07-07 AI Frameworks PyGPT szczyglis-dev/py-gpt#194 2026-07-22 Chat UI Configuration is lifted from the merged upstream code, not reconstructed: - Plano: the ProviderDefault in cli/planoai/defaults.py and the wildcard config in their own cli/test/test_config_generator.py fixture. The Rust ProviderId::EdenAI parses 'edenai' and rejects 'eden_ai', and carries no hardcoded model list, the same treatment as OpenRouter. - Repowise: the CLI flags and env vars from the CONFIG.md and .env.example we contributed, including EDENAI_BASE_URL covering both the LLM and the embedder. - PyGPT: the api_key_edenai and api_endpoint_edenai settings keys, their default endpoint value and the 'Eden AI' settings tab. Every model id cited was checked against the live catalogues. * docs: align integration page metadata with the existing pages Match the conventions already used by the merged integration pages: schema.org about values per nav section, Title Case keywords capped at five, and code block titles that name the file or tool instead of repeating the language.
Summary
EdenAIProvider) and embedder(
EdenAIEmbedder). Eden AI is an EU-headquartered gateway exposing 700+ models(Mistral, GPT, Claude, Gemini, Cohere, DeepSeek, Llama, …) behind a single
OpenAI-compatible endpoint — so it reuses the existing
openaidependencywith a custom
base_url, no new dependency.openrouter/deepseekpattern:generate(), streaming chat,live
/modelsdiscovery,EDENAI_API_KEY, and anEDENAI_BASE_URLoverridefor the EU endpoint (
https://api.eu.edenai.run/v3) for data residency.reasoningmaps to OpenAIreasoning_effortfor OpenAI reasoning models routedvia Eden; other models expose only
auto.server provider catalog, CLI provider selection/resolution/validation, embedder
auto-detection, the web settings UI, tests, and docs (
CONFIG.md,.env.example).Related Issues
Closes #704
Test Plan
pytest) — 31 new tests (test_edenai_provider.py,test_edenai_embedder.py); full provider + embedder suites: 220 passed, no regressions.ruff check) —llm/edenai.pyclean; the embedder carries thesame single
RUF012on_DIMSas the existingopenrouter.pyembedder.generate(), streamingchat,
/modelsdiscovery, and embeddings (1536-dim, L2-normalized).npm run build) — TS change is additive (new keys on existingtyped records / const arrays).
Checklist
Notes: The API key is read only from
EDENAI_API_KEY(or passed explicitly) — neverlogged or hardcoded.
.github/CONTRIBUTING.mdreferenced arun-config-form.tsxfile that no longer exists in the tree, so only
provider-section.tsxwas updated.