Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

Auto-update documentation after merge [skip ci]

camel-docs-botc04a87352413
diff --git a/docs/key_modules/models.md b/docs/key_modules/models.md
index 8c2a88a28..95f18133c 100644
--- a/docs/key_modules/models.md
+++ b/docs/key_modules/models.md
@@ -197,6 +197,8 @@ Integrate your favorite models into CAMEL-AI with straightforward Python calls.
<Tab title="Qwen">
+ Leverage [Qwen](https://qwenlm.github.io/)'s state-of-the-art models for coding and reasoning:
+
```python
from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
@@ -214,11 +216,82 @@ Integrate your favorite models into CAMEL-AI with straightforward Python calls.
print(response.msgs[0].content)
```
+ </Tab>
+
+ <Tab title="OpenRouter">
+ Access a wide variety of models through [OpenRouter](https://openrouter.ai/)'s unified API:
+
+ **Setup:** Set your OpenRouter API key as an environment variable:
+ ```bash
+ export OPENROUTER_API_KEY="your-api-key-here"
+ ```
+
+ ```python
+ from camel.models import ModelFactory
+ from camel.types import ModelPlatformType, ModelType
+ from camel.configs import OpenRouterConfig
+ from camel.agents import ChatAgent
+
+ # Using predefined OpenRouter models
+ model = ModelFactory.create(
+ model_platform=ModelPlatformType.OPENROUTER,
+ model_type=ModelType.OPENROUTER_LLAMA_3_1_70B,
+ model_config_dict=OpenRouterConfig(temperature=0.2).as_dict(),
+ )
+
+ agent = ChatAgent(
+ system_message="You are a helpful assistant.",
+ model=model
+ )
+
+ response = agent.step("Say hi to CAMEL AI community.")
+ print(response.msgs[0].content)
+ ```
+
+ <Note type="info">
+ CAMEL supports several predefined OpenRouter models including:
+ - `OPENROUTER_LLAMA_3_1_405B` - Meta's Llama 3.1 405B model
+ - `OPENROUTER_LLAMA_3_1_70B` - Meta's Llama 3.1 70B model
+ - `OPENROUTER_LLAMA_4_MAVERICK` - Meta's Llama 4 Maverick model
+ - `OPENROUTER_LLAMA_4_SCOUT` - Meta's Llama 4 Scout model
+ - `OPENROUTER_OLYMPICODER_7B` - Open R1's OlympicCoder 7B model
+ - `OPENROUTER_HORIZON_ALPHA` - Horizon Alpha model
+
+ Free versions are also available for some models (e.g., `OPENROUTER_LLAMA_4_MAVERICK_FREE`).
+ </Note>
+
+ You can also use any OpenRouter model via the OpenAI-compatible interface:
+
+ ```python
+ import os
+ from camel.models import ModelFactory
+ from camel.types import ModelPlatformType
+
+ # Use any model available on OpenRouter
+ model = ModelFactory.create(
+ model_platform=ModelPlatformType.OPENAI_COMPATIBLE_MODEL,
+ model_type="anthropic/claude-3.5-sonnet", # Any OpenRouter model
+ url="https://openrouter.ai/api/v1",
+ api_key=os.getenv("OPENROUTER_API_KEY"),
+ model_config_dict={"temperature": 0.2},
+ )
+
+ agent = ChatAgent(
+ system_message="You are a helpful assistant.",
+ model=model
+ )
+
+ response = agent.step("Explain quantum computing in simple terms.")
+ print(response.msgs[0].content)
+ ```
+
+ **Available Models:** View the full list of models available through OpenRouter at [openrouter.ai/models](https://openrouter.ai/models).
+
</Tab>
<Tab title="Groq">
- Using Groq's powerful models (e.g., Llama 3.3-70B):
+ Using [Groq](https://groq.com/)'s powerful models (e.g., Llama 3.3-70B):
```python
from camel.models import ModelFactory