Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ Each guide walks through installation, configuration, and model selection so you
| OpenClaw | [openclaw.md](./openclaw.md) | [YouTube](https://youtu.be/HxIAYOQT90Q) | [edenai.co/integrations/openclaw](https://www.edenai.co/integrations/openclaw) |
| OpenCode | [opencode.md](./opencode.md) | [YouTube](https://youtu.be/OYHRY5rblz0) | [edenai.co/integrations/opencode](https://www.edenai.co/integrations/opencode) |
| Cline | [cline.md](./cline.md) | [YouTube](https://youtu.be/_M8PwHSwgMQ) | [edenai.co/integrations/cline](https://www.edenai.co/integrations/cline) |
| aisuite | [aisuite.md](./aisuite.md) | — | — |
| any-llm | [any-llm.md](./any-llm.md) | — | — |
| Atomic Agents | [atomic-agents.md](./atomic-agents.md) | — | — |
| Haystack | [haystack.md](./haystack.md) | — | — |
| Lynkr | [lynkr.md](./lynkr.md) | — | — |
| Open Code Review | [open-code-review.md](./open-code-review.md) | — | — |
| open-connector | [open-connector.md](./open-connector.md) | — | — |

More integrations are added regularly. Open an issue if there's a tool you'd like us to cover.

Expand Down
95 changes: 95 additions & 0 deletions aisuite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# aisuite + Eden AI

[aisuite](https://github.com/andrewyng/aisuite) ships with a built-in **Eden AI** provider, so you can route any aisuite call through **500+ models** with smart routing, automatic fallbacks, and a single API key.

> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**.

---

## 1. Install

The Eden AI provider is OpenAI-compatible and reuses the `openai` client, so install aisuite with the OpenAI extra:

```bash
pip install aisuite openai
```

## 2. Set your Eden AI key

The provider reads the key from the `EDENAI_API_KEY` environment variable:

```bash
export EDENAI_API_KEY="your-eden-ai-key"
```

Never hardcode the key in your source. The base URL (`https://api.edenai.run/v3`) is built into the provider — you don't need to set it.

## 3. Call Eden AI through aisuite

Select Eden AI with the `edenai:` provider prefix, followed by a `provider/model` string:

```python
import aisuite as ai

client = ai.Client()

provider = "edenai"
model_id = "anthropic/claude-sonnet-4-5"

messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What's the weather like in San Francisco?"},
]

response = client.chat.completions.create(
model=f"{provider}:{model_id}",
messages=messages,
)

print(response.choices[0].message.content)
```

The provider is auto-discovered — no manual registration needed.

---

## Choosing a model

The aisuite model string nests Eden AI's own `provider/model` after the `edenai:` prefix:

| aisuite model string | Best for |
|---|---|
| `edenai:@edenai` | **Default** — smart routing across all providers |
| `edenai:anthropic/claude-sonnet-4-5` | Balanced reasoning |
| `edenai:openai/gpt-4o-mini` | Fast and cheap |
| `edenai:mistral/mistral-small-latest` | European, cost-efficient |

`@edenai` is Eden AI's **smart router** — it picks the best-performing model per request based on quality, latency, cost and live provider health. [How smart routing works →](https://www.edenai.co/docs/v3/llms/smart-routing)

Browse the full catalog at [app.edenai.run/models](https://app.edenai.run/models).

## Troubleshooting

### `ValueError: ... API key`
Make sure `EDENAI_API_KEY` is exported in the environment where your script runs.

### `401 Unauthorized`
Verify your Eden AI key — grab a fresh one at [app.edenai.run → API Keys](https://app.edenai.run/).

### `model not found`
The Eden AI part of the string must use the `provider/model` format (or `@edenai` for the smart router). No bare model names.

## Uninstall

```bash
pip uninstall aisuite
```

---

## Next steps

- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing)
- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback)
- [Eden AI pricing](https://www.edenai.co/pricing)
- [aisuite GitHub](https://github.com/andrewyng/aisuite)
87 changes: 87 additions & 0 deletions any-llm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# any-llm + Eden AI

[any-llm](https://github.com/mozilla-ai/any-llm) ships with a built-in **Eden AI** provider, so you can route any-llm calls through **500+ models** with smart routing, automatic fallbacks, and a single API key.

> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**.

---

## 1. Install

Install any-llm with the `edenai` extra:

```bash
pip install 'any-llm-sdk[edenai]'
```

## 2. Set your Eden AI key

The provider reads the key from the `EDENAI_API_KEY` environment variable:

```bash
export EDENAI_API_KEY="your-eden-ai-key"
```

Never hardcode the key. The base URL defaults to `https://api.edenai.run/v3`; override it with `EDENAI_API_BASE` only if you use a regional endpoint.

## 3. Call Eden AI through any-llm

Prefix the model with the `edenai/` provider id, followed by Eden AI's `provider/model` string:

```python
from any_llm import completion

response = completion(
model="edenai/openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)

print(response.choices[0].message.content)
```

Streaming, embeddings, and moderation are supported through the same provider.

---

## Choosing a model

The any-llm model string nests Eden AI's own `provider/model` after the `edenai/` prefix:

| any-llm model string | Best for |
|---|---|
| `edenai/@edenai` | **Default** — smart routing across all providers |
| `edenai/anthropic/claude-sonnet-4-5` | Balanced reasoning |
| `edenai/openai/gpt-4o-mini` | Fast and cheap |
| `edenai/mistral/mistral-small-latest` | European, cost-efficient |

For embeddings, use an embedding model such as `edenai/openai/text-embedding-3-small`.

`@edenai` is Eden AI's **smart router** — it picks the best model per request based on quality, latency, cost and live provider health. [How smart routing works →](https://www.edenai.co/docs/v3/llms/smart-routing)

Browse the full catalog at [app.edenai.run/models](https://app.edenai.run/models).

## Troubleshooting

### `401 Unauthorized`
Verify your Eden AI key — grab a fresh one at [app.edenai.run → API Keys](https://app.edenai.run/).

### `model not found`
The Eden AI part of the string must use the `provider/model` format (or `@edenai` for the smart router). No bare model names.

### Reasoning field is empty
Eden AI inlines reasoning into the message content rather than a separate field, so any-llm's dedicated reasoning output is not populated for this provider.

## Uninstall

```bash
pip uninstall any-llm-sdk
```

---

## Next steps

- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing)
- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback)
- [Eden AI pricing](https://www.edenai.co/pricing)
- [any-llm GitHub](https://github.com/mozilla-ai/any-llm)
85 changes: 85 additions & 0 deletions atomic-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Atomic Agents + Eden AI

[Atomic Agents](https://github.com/Eigenwise/atomic-agents) works with **Eden AI** out of the box through its OpenAI-compatible client, so you can build agents on top of **500+ models** with smart routing, automatic fallbacks, and a single API key.

> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**.

---

## 1. Install

Eden AI reuses the OpenAI client and Instructor that Atomic Agents already relies on:

```bash
pip install atomic-agents openai instructor
```

## 2. Set your Eden AI key

```bash
export EDENAI_API_KEY="your-eden-ai-key"
```

Never hardcode the key.

## 3. Point the client at Eden AI

Create an OpenAI client with Eden AI's base URL and wrap it with Instructor — exactly the pattern used for other OpenAI-compatible providers:

```python
import os
import instructor
from openai import OpenAI

client = instructor.from_openai(
OpenAI(
base_url="https://api.edenai.run/v3",
api_key=os.getenv("EDENAI_API_KEY"),
)
)

model = "openai/gpt-4o-mini"
model_api_parameters = {"max_tokens": 2048}
```

Pass this `client` and `model` to your `BaseAgent` (or agent config) as usual. Both Instructor `TOOLS` and `JSON` modes work.

---

## Choosing a model

Eden AI model ids use the `provider/model` format:

| Model | Best for |
|---|---|
| `@edenai` | **Default** — smart routing across all providers |
| `anthropic/claude-sonnet-4-5` | Balanced reasoning |
| `anthropic/claude-haiku-4-5` | Fast and cheap |
| `mistral/mistral-small-latest` | European, cost-efficient |

`@edenai` is Eden AI's **smart router** — it picks the best model per request based on quality, latency, cost and live provider health. [How smart routing works →](https://www.edenai.co/docs/v3/llms/smart-routing)

Browse the full catalog at [app.edenai.run/models](https://app.edenai.run/models).

## Troubleshooting

### `api_key` is `None`
Make sure `EDENAI_API_KEY` is exported in the environment where your script runs.

### `401 Unauthorized`
Verify your Eden AI key — grab a fresh one at [app.edenai.run → API Keys](https://app.edenai.run/).

### `model not found`
Use the `provider/model` format (or `@edenai` for the smart router). No bare model names.

### Connection issues
Confirm the base URL is exactly `https://api.edenai.run/v3` and check Eden AI status at [app-edenai.instatus.com](https://app-edenai.instatus.com/).

---

## Next steps

- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing)
- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback)
- [Eden AI pricing](https://www.edenai.co/pricing)
- [Atomic Agents GitHub](https://github.com/Eigenwise/atomic-agents)
105 changes: 105 additions & 0 deletions haystack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Haystack + Eden AI

The [Haystack](https://haystack.deepset.ai/) Eden AI integration adds native chat and embedding components, so you can build pipelines on top of **500+ models** with smart routing, automatic fallbacks, and a single API key.

> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**.

---

## 1. Install

```bash
pip install edenai-haystack
```

Requires Haystack 2.14.0 or newer.

## 2. Set your Eden AI key

The components read the key from the `EDENAI_API_KEY` environment variable (via Haystack's `Secret.from_env_var`):

```bash
export EDENAI_API_KEY="your-eden-ai-key"
```

Never hardcode the key.

## 3. Generate a chat response

```python
from haystack_integrations.components.generators.edenai import EdenAIChatGenerator
from haystack.dataclasses import ChatMessage

generator = EdenAIChatGenerator(model="mistral/mistral-large-latest")
result = generator.run([ChatMessage.from_user("What's the capital of France?")])
print(result["replies"][0].text)
```

The chat generator supports streaming (`streaming_callback`), async (`run_async`), and tool/function calling. Pass generation parameters via `generation_kwargs`, e.g. `{"temperature": 0.2, "max_tokens": 512}`.

## 4. Embed text and documents

```python
from haystack import Document
from haystack_integrations.components.embedders.edenai import (
EdenAIDocumentEmbedder,
EdenAITextEmbedder,
)

doc_embedder = EdenAIDocumentEmbedder(model="mistral/mistral-embed")
docs = doc_embedder.run([Document(content="I love pizza!")])["documents"]

text_embedder = EdenAITextEmbedder(model="mistral/mistral-embed")
query_embedding = text_embedder.run("What food do I love?")["embedding"]
```

---

## Choosing a model

Eden AI model ids use the `provider/model` format.

**Chat**

| Model | Best for |
|---|---|
| `openai/gpt-4o-mini` | **Default** — fast and cheap |
| `anthropic/claude-sonnet-4-5` | Balanced reasoning |
| `mistral/mistral-large-latest` | European, strong general model |
| `google/gemini-2.5-flash` | Long context, multimodal |

**Embeddings**

| Model | Best for |
|---|---|
| `openai/text-embedding-3-small` | **Default** — cost-efficient |
| `openai/text-embedding-3-large` | Higher accuracy |
| `mistral/mistral-embed` | European embeddings |

Browse the full catalog at [app.edenai.run/models](https://app.edenai.run/models).

## Troubleshooting

### `401 Unauthorized`
Verify your Eden AI key — grab a fresh one at [app.edenai.run → API Keys](https://app.edenai.run/).

### `400 Model(s) not found or inactive`
The model must be active on your Eden AI account and use the `provider/model` format. No bare model names.

### Connection issues
The components target `https://api.edenai.run/v3`. Check Eden AI status at [app-edenai.instatus.com](https://app-edenai.instatus.com/).

## Uninstall

```bash
pip uninstall edenai-haystack
```

---

## Next steps

- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing)
- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback)
- [Eden AI pricing](https://www.edenai.co/pricing)
- [Haystack integration on GitHub](https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/edenai)
Loading
Loading