Skip to main content
Install one package and the Eden AI components drop into any Haystack pipeline, so you can mix chat and embedding models from different providers without changing pipeline code.

Overview

Haystack is deepset’s open-source Python framework for building production LLM applications, RAG pipelines and agents. Eden AI ships as an official Haystack integration (the edenai-haystack package), so your pipelines reach models from OpenAI, Anthropic, Google, Mistral and hundreds more behind one key. The integration provides three components:
  • EdenAIChatGenerator for chat completion
  • EdenAITextEmbedder to embed a query string
  • EdenAIDocumentEmbedder to embed documents for indexing

Installation

The package requires Python 3.11 or later.

Quick Start

Set your key, then generate a chat response with the EdenAIChatGenerator:
The generator reads your key from the EDENAI_API_KEY environment variable by default.

Model naming

Models use the provider/model format, for example anthropic/claude-sonnet-latest for chat and openai/text-embedding-3-small for embeddings. See List LLM Models for the live catalog.

Switching models

Change providers by changing the model string. Every Eden AI chat model is reachable the same way:

Streaming

Pass a streaming_callback to stream tokens as they are generated:

Embeddings and RAG

Use EdenAITextEmbedder to embed a query and EdenAIDocumentEmbedder to embed documents, so you can build a RAG pipeline (retrieval and generation) with one Eden AI key:

Environment Variables

EDENAI_API_KEY is read by EdenAIChatGenerator, EdenAITextEmbedder and EdenAIDocumentEmbedder, as shown in the Quick Start. To override it, import Secret with from haystack.utils import Secret and pass api_key=Secret.from_token("...") to a component.

Next Steps