diff --git a/README.md b/README.md index cfda65f..802987d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/aisuite.md b/aisuite.md new file mode 100644 index 0000000..024d260 --- /dev/null +++ b/aisuite.md @@ -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) diff --git a/any-llm.md b/any-llm.md new file mode 100644 index 0000000..e8968e9 --- /dev/null +++ b/any-llm.md @@ -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) diff --git a/atomic-agents.md b/atomic-agents.md new file mode 100644 index 0000000..190adf5 --- /dev/null +++ b/atomic-agents.md @@ -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) diff --git a/haystack.md b/haystack.md new file mode 100644 index 0000000..f7dd718 --- /dev/null +++ b/haystack.md @@ -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) diff --git a/lynkr.md b/lynkr.md new file mode 100644 index 0000000..4396aa6 --- /dev/null +++ b/lynkr.md @@ -0,0 +1,92 @@ +# Lynkr + Eden AI + +[Lynkr](https://github.com/Fast-Editor/Lynkr) ships with a first-class **Eden AI** provider, so you can route your local gateway 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 Lynkr + +```bash +npm install -g lynkr +``` + +Or with the one-line installer: + +```bash +curl -fsSL https://raw.githubusercontent.com/Fast-Editor/Lynkr/main/install.sh | bash +``` + +(Homebrew: `brew tap fast-editor/lynkr && brew install lynkr`.) + +## 2. Configure Eden AI + +Set Eden AI as the provider in your environment / `.env`: + +```env +MODEL_PROVIDER=edenai +EDENAI_API_KEY=your-edenai-key +EDENAI_MODEL=anthropic/claude-sonnet-4-5 +EDENAI_ENDPOINT=https://api.edenai.run/v3/chat/completions +``` + +Never hardcode the key in committed files. You can also run `lynkr init` to configure Eden AI through the setup wizard (labelled *Eden AI (600+ models, one key, EU/GDPR)*). + +## 3. Start Lynkr + +Lynkr serves an OpenAI-compatible endpoint on port `8081` by default (`http://localhost:8081/v1`), with a dashboard at `http://localhost:8081/dashboard`. Point your app at that base URL and every request flows through Eden AI. + +--- + +## Per-tier routing + +Lynkr can map its complexity tiers to specific Eden AI models using the `:` syntax: + +```env +TIER_SIMPLE=edenai:openai/gpt-4o-mini +TIER_MEDIUM=edenai:openai/gpt-4o +TIER_COMPLEX=edenai:anthropic/claude-sonnet-4-5 +TIER_REASONING=edenai:anthropic/claude-opus-4-8 +``` + +## Choosing a model + +Eden AI model ids use the `provider/model` format: + +| Model | Best for | +|---|---| +| `anthropic/claude-sonnet-4-5` | Coding and balanced reasoning | +| `openai/gpt-4o` | General purpose | +| `openai/gpt-4o-mini` | **Default** — fast and cheap | +| `google/gemini-2.5-flash` | Fast, long context | + +Embeddings use `EDENAI_EMBEDDINGS_MODEL` (default `openai/text-embedding-ada-002`) against `https://api.edenai.run/v3/embeddings`. + +Browse the full catalog at [app.edenai.run/models](https://app.edenai.run/models). + +## Troubleshooting + +### `401 Unauthorized` +Verify `EDENAI_API_KEY` — grab a fresh one at [app.edenai.run → API Keys](https://app.edenai.run/). + +### `model not found` +Model ids must use the `provider/model` format. No bare model names. + +### Data residency +For EU/GDPR data residency, point `EDENAI_ENDPOINT` at `https://api.eu.edenai.run/v3/chat/completions`. + +## Uninstall + +```bash +npm uninstall -g lynkr +``` + +--- + +## 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) +- [Lynkr GitHub](https://github.com/Fast-Editor/Lynkr) diff --git a/open-code-review.md b/open-code-review.md new file mode 100644 index 0000000..190b8d9 --- /dev/null +++ b/open-code-review.md @@ -0,0 +1,81 @@ +# Open Code Review + Eden AI + +[Open Code Review](https://github.com/alibaba/open-code-review) (`ocr`) ships with a built-in **Eden AI** provider, so you can run AI code reviews 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 +npm install -g @alibaba-group/open-code-review +``` + +After installation, the `ocr` command is available globally. + +## 2. Set your Eden AI key + +```bash +export EDENAI_API_KEY="your-eden-ai-key" +``` + +Never hardcode the key. + +## 3. Select Eden AI as the provider + +```bash +ocr config provider # pick "Eden AI" from the built-in providers +ocr config model # pick a model for Eden AI +``` + +`ocr config provider` picks up `EDENAI_API_KEY` automatically (or lets you paste a key interactively). The base URL (`https://api.edenai.run/v3`) is built into the preset. + +## 4. Run a review + +```bash +ocr review # review the current diff +ocr review --from main --to feature-branch # review a branch +ocr scan --path internal/agent # audit files with no diff +``` + +--- + +## Choosing a model + +Eden AI model ids use the `provider/model` format. The Eden AI preset curates a shortlist, but any active model on your account works by id: + +| Model | Best for | +|---|---| +| `anthropic/claude-sonnet-4-5` | Balanced, strong code reasoning | +| `openai/gpt-5.1-codex` | Code-specialized | +| `mistral/codestral-latest` | Fast code model | +| `anthropic/claude-haiku-4-5` | Cheap and fast | + +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` +Model ids must use the `provider/model` format. No bare model names. Re-run `ocr config model` to pick a valid one. + +### Connection issues +The Eden AI preset targets `https://api.edenai.run/v3`. Check Eden AI status at [app-edenai.instatus.com](https://app-edenai.instatus.com/). + +## Uninstall + +```bash +npm uninstall -g @alibaba-group/open-code-review +``` + +--- + +## 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) +- [Open Code Review GitHub](https://github.com/alibaba/open-code-review) diff --git a/open-connector.md b/open-connector.md new file mode 100644 index 0000000..5f44d59 --- /dev/null +++ b/open-connector.md @@ -0,0 +1,81 @@ +# open-connector + Eden AI + +[open-connector](https://github.com/oomol-lab/open-connector) ships with a built-in **Eden AI** connector, so you can expose **500+ models** through your self-hosted gateway 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. Run open-connector + +open-connector is a self-hosted gateway. Start the runtime with Docker: + +```bash +docker compose up +``` + +This pulls `ghcr.io/oomol-lab/open-connector:latest` and serves the console and API at `http://localhost:3000`. + +## 2. Add your Eden AI credential + +The Eden AI key is stored as a connection credential (not an environment variable): + +```bash +curl -s -X PUT http://localhost:3000/api/connections/edenai \ + -H 'content-type: application/json' \ + -d '{"authType":"api_key","values":{"apiKey":"your-eden-ai-key"}}' +``` + +The base URL (`https://api.edenai.run/v3`) is built into the connector. + +## 3. Call Eden AI + +The `edenai` service exposes two actions: `edenai.list_models` and `edenai.create_chat_completion`. + +```bash +curl -s -X POST http://localhost:3000/v1/actions/edenai.create_chat_completion \ + -H 'content-type: application/json' \ + -d '{ + "input": { + "model": "openai/gpt-4o-mini", + "messages": [{"role": "user", "content": "Hello"}] + } + }' +``` + +The response includes the standard OpenAI-compatible fields plus a top-level `cost` field with the Eden AI billed cost. + +--- + +## Choosing a model + +Eden AI model ids use the `provider/model` format: + +| Model | Best for | +|---|---| +| `openai/gpt-4o-mini` | Fast and cheap | +| `anthropic/claude-haiku-4-5` | Cheap, strong quality | +| `anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `mistral/mistral-small-latest` | European, cost-efficient | + +List everything available with `edenai.list_models`, or browse the full catalog at [app.edenai.run/models](https://app.edenai.run/models). + +## Troubleshooting + +### `stream=true is not supported by connector actions` +Connector actions are non-streaming. Omit `stream` or set it to `false`. + +### `401 Unauthorized` +Re-check the credential you stored via `PUT /api/connections/edenai`. Manage keys at [app.edenai.run → API Keys](https://app.edenai.run/). + +### `model not found` +Model ids must use the `provider/model` format. No bare model names. + +--- + +## 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) +- [open-connector GitHub](https://github.com/oomol-lab/open-connector)