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 (theedenai-haystack package), so your pipelines reach models from OpenAI, Anthropic, Google, Mistral and hundreds more behind one key.
The integration provides three components:
EdenAIChatGeneratorfor chat completionEdenAITextEmbedderto embed a query stringEdenAIDocumentEmbedderto embed documents for indexing
Installation
The package requires Python 3.11 or later.Quick Start
Set your key, then generate a chat response with theEdenAIChatGenerator:
EDENAI_API_KEY environment variable by default.
Model naming
Models use theprovider/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 themodel string. Every Eden AI chat model is reachable the same way:
Streaming
Pass astreaming_callback to stream tokens as they are generated:
Embeddings and RAG
UseEdenAITextEmbedder 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
- Chat Completions - Core LLM endpoint
- List LLM Models - Browse available providers and models
- aisuite - Another unified LLM interface
- LangChain - Build LLM apps with LangChain