Skip to content

feat: add Eden AI integration (chat generator + embedders)#3615

Merged
sjrl merged 4 commits into
deepset-ai:mainfrom
MVS-source:integration/add-edenai
Jul 21, 2026
Merged

feat: add Eden AI integration (chat generator + embedders)#3615
sjrl merged 4 commits into
deepset-ai:mainfrom
MVS-source:integration/add-edenai

Conversation

@MVS-source

Copy link
Copy Markdown
Contributor

Related Issues

Supersedes #3517 (closed). Re-opened via the monorepo route, as discussed with the maintainers.

Proposed Changes:

Adds a new integrations/edenai/ package that integrates Eden AI with Haystack.

Eden AI exposes 500+ models from providers such as OpenAI, Anthropic, Google, Mistral and more behind a single, OpenAI-compatible API — EU-hosted and GDPR-aligned, with unified billing.

New components:

  • EdenAIChatGenerator — chat completions through Eden AI's OpenAI-compatible endpoint (https://api.edenai.run/v3), using the provider/model naming scheme (e.g. anthropic/claude-sonnet-5).
  • EdenAITextEmbedder — embeds a string.
  • EdenAIDocumentEmbedder — embeds a list of Documents.

The package follows the standard monorepo layout: pyproject.toml (package edenai-haystack, tag pattern integrations/edenai-v*), pydoc config, README, CHANGELOG, an examples/edenai_rag_pipeline.py, the .github/workflows/edenai.yml CI workflow, a .github/labeler.yml entry and a row in the root README.

How did you test it?

  • Unit tests for the chat generator (sync + async), the text embedder and the document embedder.
  • Manual live verification against the Eden AI API:
    • Chat — mistral/mistral-small-2603 → HTTP 200.
    • Embeddings — openai/text-embedding-3-small → HTTP 200, 1536-dim vectors.
  • The edenai.yml workflow runs the suite. The live tests read EDENAI_API_KEY.

Notes for the reviewer

  • CI secret required: the live tests need an EDENAI_API_KEY repo secret. I have a scoped key ready — happy to share it through whatever secure channel you prefer. (Note: GitHub does not expose repo secrets to workflows triggered from a fork, so the live-test job won't have the key on this PR; it can run post-merge or via your usual maintainer trigger.)
  • Conventions: package name edenai-haystack, tag pattern integrations/edenai-v*, aligned with the other integrations.
  • CLA: signed.

Checklist

@MVS-source
MVS-source requested a review from a team as a code owner July 20, 2026 13:46
@MVS-source
MVS-source requested review from sjrl and removed request for a team July 20, 2026 13:46
@CLAassistant

CLAassistant commented Jul 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added topic:CI type:documentation Improvements or additions to documentation labels Jul 20, 2026
@sjrl

sjrl commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Before we review the implementation, could you clarify what changed since the previous PR? In the earlier discussion, the agreed direction was for Eden AI to host and maintain edenai-haystack in the Eden AI GitHub organization and publish it independently, rather than adding it to haystack-core-integrations as mentioned in this comment #3517 (comment)

Is that still an option you would be open to? Given that Eden AI would own the integration, credentials, releases, and ongoing compatibility with the model catalog, hosting the code in your own organization would likely give you more control over maintenance and release cadence. We could then look at listing it in the official Haystack integrations catalog.

Update: Aligned on slack

cc @julian-risch

@julian-risch

Copy link
Copy Markdown
Member

Is that still an option you would be open to? Given that Eden AI would own the integration, credentials, releases, and ongoing compatibility with the model catalog, hosting the code in your own organization would likely give you more control over maintenance and release cadence. We could then look at listing it in the official Haystack integrations catalog.

@sjrl @bilgeyucel aligned with Eden AI via slack on re-opening their PR. I will set up an API key with their help.

@sjrl

sjrl commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@MVS-source thanks so much for the contribution! It looks like the commits were made with the identity MVS-source, which isn’t currently connected to a GitHub account.

Could you please add the email address used for those commits to the GitHub account that opened the PR, then sign the CLA with that account? Once that’s done, you can use the recheck link above to refresh the status.

Thanks again for helping us get this sorted!

@sjrl sjrl self-assigned this Jul 20, 2026
@MVS-source
MVS-source force-pushed the integration/add-edenai branch from c466777 to c25ec75 Compare July 20, 2026 14:55
Comment thread integrations/edenai/CHANGELOG.md Outdated
Comment thread integrations/edenai/README.md
Comment thread integrations/edenai/pyproject.toml Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator.py Outdated
Comment thread integrations/edenai/tests/test_edenai_chat_generator_async.py Outdated
Comment thread integrations/edenai/tests/test_edenai_text_embedder.py Outdated
- drop the haystack-ai upper pin (verified against Haystack 3.0)
- use ToolsType from haystack.tools in EdenAIChatGenerator
- add to_dict to EdenAIChatGenerator (drops api_base_url/organization so it round-trips)
- make embedder init params keyword-only; let the base class hold timeout/max_retries
- trim tests to Eden AI-specific behaviour; drop the async test file
- remove hand-written CHANGELOG; slim README to match sibling integrations
@MVS-source

Copy link
Copy Markdown
Contributor Author

Thanks a lot for the detailed review, @sjrl — really appreciate you taking the time to go through it so thoroughly. 🙏

Just pushed a commit addressing everything:

  • dropped the haystack-ai upper pin — verified the suite against both Haystack 2.30 and 3.0
  • switched to ToolsType from haystack.tools and added a to_dict to EdenAIChatGenerator (drops api_base_url/organization so it round-trips)
  • made the embedder init params keyword-only and let the base class hold timeout/max_retries
  • trimmed the tests down to Eden AI-specific behaviour and dropped the async test file
  • removed the CHANGELOG and slimmed the README to match the Mistral one

Happy to follow up with the catalog page in haystack-integrations as a separate PR. Re-requesting your review — thanks again!

@sjrl

sjrl commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@MVS-source thanks for responding so quickly! And for addressing all of my comments.

It should be almost good to go. One thing I did forget to mention is could you add an entry to

its what we use to track code coverage on integrations.

I'll also give another look over of the code and would definitely appreciate a follow up PR in haystack-integrations

- add the @component decorator (like the other integrations)
- use the explicit super(EdenAIChatGenerator, self) form since @component recreates the class
- re-implement to_dict via default_to_dict with only the init parameters (drops api_base_url and organization), following the cometapi pattern
@MVS-source

Copy link
Copy Markdown
Contributor Author

Thanks @sjrl! Pushed a commit addressing the chat generator comments:

  • added the @component decorator
  • switched to the explicit super(EdenAIChatGenerator, self) form since @component recreates the class
  • re-implemented to_dict with default_to_dict following the cometapi pattern, so only the __init__ parameters are serialized (api_base_url and organization are dropped) and it round-trips regardless of upstream OpenAIChatGenerator changes

On SUPPORTED_MODELS: I matched the sibling chat generators (cometapi, mistral, etc.), which don't define one on the chat class, since Eden AI is a 500+ model gateway. Happy to add a non-exhaustive list for consistency with the embedders if you'd prefer.

Validated the full suite against Haystack 2.30 and 3.0. Thanks again!

@sjrl

sjrl commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Thanks @MVS-source!

For this point

On SUPPORTED_MODELS: I matched the sibling chat generators (cometapi, mistral, etc.), which don't define one on the chat class, since Eden AI is a 500+ model gateway. Happy to add a non-exhaustive list for consistency with the embedders if you'd prefer.

no worries then, that is a lot of models 😅

@sjrl

sjrl commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@MVS-source one last thing, could you do what's described in this comment? #3615 (comment)

@MVS-source

Copy link
Copy Markdown
Contributor Author

Done, added - "Test / edenai" to .github/workflows/CI_coverage_comment.yml (between e2b and elasticsearch).

And yes, I'll follow up with the catalog page PR in haystack-integrations. Thanks!

@sjrl sjrl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the contribution!

@sjrl
sjrl merged commit 516c5fb into deepset-ai:main Jul 21, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:edenai topic:CI type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants