diff --git a/docs.json b/docs.json index 3cd0e52..bb804d6 100644 --- a/docs.json +++ b/docs.json @@ -224,7 +224,8 @@ "v3/integrations/openai-sdk-python", "v3/integrations/openai-sdk-typescript", "v3/integrations/langchain", - "v3/integrations/pydantic-ai" + "v3/integrations/pydantic-ai", + "v3/integrations/aisuite" ] }, { diff --git a/integration-logo/aisuite-icondoc.svg b/integration-logo/aisuite-icondoc.svg new file mode 100644 index 0000000..91cde0a --- /dev/null +++ b/integration-logo/aisuite-icondoc.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/v3/integrations/aisuite.mdx b/v3/integrations/aisuite.mdx new file mode 100644 index 0000000..605f532 --- /dev/null +++ b/v3/integrations/aisuite.mdx @@ -0,0 +1,146 @@ +--- +title: "aisuite" +icon: "/integration-logo/aisuite-icondoc.svg" +description: "Use aisuite with Eden AI to call 500+ AI models through one unified, OpenAI-style interface." +--- + +import { TechArticleSchema } from "/snippets/TechArticleSchema.mdx"; + + + +Use aisuite with Eden AI to call 500+ AI models through one unified, OpenAI-style interface. + +## Overview + +[aisuite](https://github.com/andrewyng/aisuite) is a lightweight Python library (from Andrew Ng's team) that gives you a single, OpenAI-style Chat Completions interface across many providers — swap providers by changing one string. **Eden AI is a built-in aisuite provider**, so you reach models from OpenAI, Anthropic, Google, Mistral, Cohere, Meta and more behind one key, with EU-based, GDPR-aligned inference. + +You select a model with the `provider:model_id` syntax. For Eden AI, the provider is `edenai` and the model id follows Eden AI's `provider/model` scheme — for example `edenai:anthropic/claude-sonnet-5`. + +## Installation + +Eden AI is OpenAI-compatible, so aisuite talks to it through the `openai` SDK — install both: + + +```bash pip +pip install aisuite openai +``` + +```bash poetry +poetry add aisuite openai +``` + + +## Quick Start + +Set your key, then point aisuite at Eden AI by prefixing any model with `edenai:`: + + +```bash .env +EDENAI_API_KEY=your_api_key_here +``` + +{/* skip-test */} +```python Python +import aisuite as ai + +client = ai.Client() + +response = client.chat.completions.create( + model="edenai:anthropic/claude-sonnet-5", # edenai:/ + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Hello! How are you?"}, + ], +) + +print(response.choices[0].message.content) +``` + + +The `edenai` provider automatically uses the Eden AI base URL (`https://api.edenai.run/v3`) and reads your key from the `EDENAI_API_KEY` environment variable. + +## Switching models + +aisuite's core benefit: change providers by changing one string. Every Eden AI model is reachable the same way — no per-provider SDKs, no code changes: + + +{/* skip-test */} +```python Python +import aisuite as ai + +client = ai.Client() +messages = [{"role": "user", "content": "Write a haiku about the sea."}] + +for model in [ + "edenai:openai/gpt-5.5", + "edenai:anthropic/claude-sonnet-5", + "edenai:mistral/mistral-large-2512", +]: + response = client.chat.completions.create(model=model, messages=messages) + print(model, "->", response.choices[0].message.content) +``` + + +## Available Models + +Use the `edenai:/` format for any Eden AI model: + +**OpenAI** +- `edenai:openai/gpt-5.5` +- `edenai:openai/gpt-5-mini` + +**Anthropic** +- `edenai:anthropic/claude-sonnet-5` +- `edenai:anthropic/claude-opus-4-8` +- `edenai:anthropic/claude-haiku-4-5` + +**Google** +- `edenai:google/gemini-2.5-pro` +- `edenai:google/gemini-3.5-flash` + +**Mistral** +- `edenai:mistral/mistral-large-2512` +- `edenai:mistral/mistral-small-2603` + +## Passing configuration explicitly + +Prefer not to use environment variables? Pass the key through the aisuite client config instead: + + +{/* skip-test */} +```python Python +import aisuite as ai + +client = ai.Client({"edenai": {"api_key": "YOUR_EDENAI_API_KEY"}}) + +response = client.chat.completions.create( + model="edenai:mistral/mistral-large-2512", + messages=[{"role": "user", "content": "Say hello in French."}], +) +print(response.choices[0].message.content) +``` + + +## Environment Variables + + +```bash .env +EDENAI_API_KEY=your_api_key_here +``` + + +## Next Steps + +- [Chat Completions](/v3/llms/chat-completions) - Core LLM endpoint +- [List LLM Models](/v3/llms/listing-models) - Browse available providers and models +- [OpenAI SDK (Python)](/v3/integrations/openai-sdk-python) - Direct SDK usage