๐ซ CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
Auto-update documentation after merge [skip ci]
camel-docs-botf9e14740c76c
diff --git a/docs/mintlify/key_modules/models.mdx b/docs/mintlify/key_modules/models.mdxindex feb9a5122..41d7bc28f 100644--- a/docs/mintlify/key_modules/models.mdx+++ b/docs/mintlify/key_modules/models.mdx@@ -431,91 +431,6 @@ Integrate your favorite models into CAMEL-AI with straightforward Python calls.</Tab>- <Tab title="OrcaRouter">-- [OrcaRouter](https://www.orcarouter.ai/) is an OpenAI-compatible LLM gateway with an adaptive routing engine that picks the upstream model per request:-- - **OrcaRouter Platform** ([www.orcarouter.ai](https://www.orcarouter.ai/)): Unified access across many upstream model providers.- - **API Key Setup**: Obtain your OrcaRouter API key from the dashboard at [www.orcarouter.ai](https://www.orcarouter.ai/).- - **Model Catalog** ([www.orcarouter.ai/models](https://www.orcarouter.ai/models)): Full list of supported upstream models.- - **OrcaRouter Docs** ([docs.orcarouter.ai](https://docs.orcarouter.ai/)): API and routing reference.-- ```python- from camel.models import ModelFactory- from camel.types import ModelPlatformType, ModelType- from camel.configs import OrcaRouterConfig- from camel.agents import ChatAgent-- model = ModelFactory.create(- model_platform=ModelPlatformType.ORCAROUTER,- model_type=ModelType.ORCAROUTER_AUTO,- model_config_dict=OrcaRouterConfig(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)- ```-- ### How `orcarouter/auto` works-- `orcarouter/auto` is **not a model id** โ it's the default **router name** that OrcaRouter seeds for every workspace. The actual upstream model is chosen at runtime by the router's configured strategy:-- | Strategy | Behavior |- |---|---|- | `cheapest` | Lowest-priced upstream that can serve the request (default) |- | `balanced` | Trades off price vs latency vs quality |- | `quality` | Highest-quality upstream |- | `adaptive` (LinUCB) | A linear contextual bandit (Li et al., WWW 2010) that picks among candidate upstreams from a learned weight vector over per-request features โ prompt length, code/math/JSON density, declared `max_tokens` budget tier, and MinHash-LSH similarity to recent traffic |- | `gated_adaptive` | Layers a task-difficulty score on top of `adaptive` โ mundane prompts are restricted to a "weak" model pool, hard prompts to a "strong" pool, and the bandit picks within each pool. Both the difficulty thresholds and the pool memberships are admin-configurable |-- The adaptive strategies update each candidate's weights from a reward signal that combines success, cost, latency, rate-limit hits, and structured-output format compliance โ so cost / quality / reliability tradeoffs are continuously tuned without manual intervention.-- #### Why this matters-- - **Self-tuning** โ the adaptive strategies learn from your own traffic, so the routing improves as your workload mix shifts. No retraining scripts to babysit.- - **Microsecond overhead** โ feature extraction and the bandit step are closed-form math; routing adds no measurable latency on top of the chosen upstream's response time.- - **Workload-aware in one call** โ the same `orcarouter/auto` endpoint serves a 50-token summary and a 30K-token code refactor, picking the appropriate upstream for each. No client-side dispatch logic to maintain.- - **Cost & reliability guardrails by construction** โ the reward signal explicitly penalises cost, latency, rate-limit hits, and structured-output format failures, so expensive / unreliable upstreams lose weight automatically.- - **Similarity-aware**, not just keyword-matched โ MinHash-LSH clusters prompts by approximate Jaccard similarity, so the bandit learns from "prompts that look like this" rather than identical strings.- - **Admin-tunable without redeploys** โ strategies, allowed-upstreams pools, difficulty thresholds, and reward weights are all configurable from the console without touching client code.- - **Per-router isolation** โ you can run multiple named routers (`orcarouter/agent-cheap`, `orcarouter/agent-quality`, โฆ) with different strategies side by side, all from the same API key.-- Configure strategies, allowed upstreams, pools, and difficulty thresholds at [www.orcarouter.ai/console/routing](https://www.orcarouter.ai/console/routing). You can also create custom named routers and use them as `orcarouter/<router-name>`.-- **Environment Variables:**- ```bash- export ORCAROUTER_API_KEY="your_orcarouter_api_key_here"- export ORCAROUTER_API_BASE_URL="https://api.orcarouter.ai/v1" # Optional- ```-- **Model Support:**- - **Smart routing:** `ORCAROUTER_AUTO` targets the default router (see above).- - **Predefined enums:** Flagship models โ `ORCAROUTER_GPT_5`, `ORCAROUTER_CLAUDE_OPUS_4_7`, `ORCAROUTER_GEMINI_3_FLASH_PREVIEW`, `ORCAROUTER_GROK_4_3` โ discoverable in IDE autocomplete.- - **String-based access:** Pass any model id from [www.orcarouter.ai/models](https://www.orcarouter.ai/models) directly as a string for maximum flexibility.-- **Example pinning a specific model via predefined enum:**- ```python- model = ModelFactory.create(- model_platform=ModelPlatformType.ORCAROUTER,- model_type=ModelType.ORCAROUTER_CLAUDE_OPUS_4_7,- )- ```-- **Example pinning an arbitrary model via free-form string:**- ```python- model = ModelFactory.create(- model_platform=ModelPlatformType.ORCAROUTER,- model_type="qwen/qwen3.5-flash",- )- ```-- </Tab>-<Tab title="Groq">Using [Groq](https://groq.com/)'s powerful models (e.g., Llama 3.3-70B):diff --git a/docs/mintlify/reference/camel.configs.orcarouter_config.mdx b/docs/mintlify/reference/camel.configs.orcarouter_config.mdxnew file mode 100644index 000000000..cb1128953--- /dev/null+++ b/docs/mintlify/reference/camel.configs.orcarouter_config.mdx@@ -0,0 +1,30 @@+<a id="camel.configs.orcarouter_config"></a>++<a id="camel.configs.orcarouter_config.OrcaRouterConfig"></a>++## OrcaRouterConfig++```python+class OrcaRouterConfig(BaseConfig):+```++Defines the parameters for generating chat completions using OpenAI+compatibility via OrcaRouter.++Reference: https://docs.orcarouter.ai/++**Parameters:**++- **temperature** (float, optional): Sampling temperature to use, between :obj:`0` and :obj:`2`. Higher values make the output more random, while lower values make it more focused and deterministic. (default: :obj:`None`)+- **top_p** (float, optional): An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So :obj:`0.1` means only the tokens comprising the top 10% probability mass are considered. (default: :obj:`None`)+- **n** (int, optional): How many chat completion choices to generate for each input message. (default: :obj:`None`)+- **response_format** (object, optional): An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. Setting to `{"type": "json_object"}` enables JSON mode, which guarantees the message the model generates is valid JSON. Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.+- **stream** (bool, optional): If True, partial message deltas will be sent as data-only server-sent events as they become available. (default: :obj:`None`)+- **stop** (str or list, optional): Up to :obj:`4` sequences where the API will stop generating further tokens. (default: :obj:`None`)+- **max_tokens** (int, optional): The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. (default: :obj:`None`)+- **presence_penalty** (float, optional): Number between :obj:`-2.0` and :obj:`2.0`. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. See more information about frequency and presence penalties. (default: :obj:`None`)+- **frequency_penalty** (float, optional): Number between :obj:`-2.0` and :obj:`2.0`. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. See more information about frequency and presence penalties. (default: :obj:`None`)+- **user** (str, optional): A unique identifier representing your end-user, which can help OrcaRouter to monitor and detect abuse. (default: :obj:`None`)+- **tools** (list[FunctionTool], optional): A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. (default: :obj:`None`)+- **tool_choice** (Union[dict[str, str], str], optional): Controls which (if any) tool is called by the model. :obj:`"none"` means the model will not call any tool and instead generates a message. :obj:`"auto"` means the model can pick between generating a message or calling one or more tools. :obj:`"required"` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. :obj:`"none"` is the default when no tools are present. :obj:`"auto"` is the default if tools are present. (default: :obj:`None`)+- **extra_body** (Dict[str, Any], optional): Extra request body fields to pass through to OrcaRouter, such as routing preferences or fallback model lists. (default: :obj:`None`)diff --git a/docs/mintlify/reference/camel.models.orcarouter_model.mdx b/docs/mintlify/reference/camel.models.orcarouter_model.mdxnew file mode 100644index 000000000..8fda239ce--- /dev/null+++ b/docs/mintlify/reference/camel.models.orcarouter_model.mdx@@ -0,0 +1,51 @@+<a id="camel.models.orcarouter_model"></a>++<a id="camel.models.orcarouter_model.OrcaRouterModel"></a>++## OrcaRouterModel++```python+class OrcaRouterModel(OpenAICompatibleModel):+```++LLM API served by OrcaRouter in a unified OpenAICompatibleModel+interface.++OrcaRouter is an OpenAI-compatible LLM gateway that routes each request+to the cheapest or fastest upstream provider for the requested model.++Quickstart: pass `__INLINE_CODE_0__` to let OrcaRouter pick the+upstream for you โ no need to know specific model ids. To pin a specific+model, use one of the predefined `__INLINE_CODE_1__` enums+(discoverable in IDE autocomplete) or pass any model id from the full+catalog at https://www.orcarouter.ai/models as a free-form string (e.g.+`__INLINE_CODE_2__`).++**Parameters:**++- **model_type** (Union[ModelType, str]): Model for which a backend is created.+- **model_config_dict** (Optional[Dict[str, Any]], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`.+- **If**: obj:`None`, :obj:`OrcaRouterConfig().as_dict()` will be used. (default: :obj:`None`)+- **api_key** (Optional[str], optional): The API key for authenticating with the OrcaRouter service. (default: :obj:`None`).+- **url** (Optional[str], optional): The url to the OrcaRouter service. (default: :obj:`None`)+- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)+- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.++<a id="camel.models.orcarouter_model.OrcaRouterModel.__init__"></a>++### __init__++```python+def __init__(+ self,+ model_type: Union[ModelType, str],+ model_config_dict: Optional[Dict[str, Any]] = None,+ api_key: Optional[str] = None,+ url: Optional[str] = None,+ token_counter: Optional[BaseTokenCounter] = None,+ timeout: Optional[float] = None,+ max_retries: int = 3,+ **kwargs: Any+):+```diff --git a/docs/mintlify/reference/camel.types.enums.mdx b/docs/mintlify/reference/camel.types.enums.mdxindex a04ecc890..57ab6f21d 100644--- a/docs/mintlify/reference/camel.types.enums.mdx+++ b/docs/mintlify/reference/camel.types.enums.mdx@@ -180,6 +180,16 @@ def is_openrouter(self):Returns whether this type of models is served by OpenRouter.+<a id="camel.types.enums.ModelType.is_orcarouter"></a>++### is_orcarouter++```python+def is_orcarouter(self):+```++Returns whether this type of models is served by OrcaRouter.+<a id="camel.types.enums.ModelType.is_lmstudio"></a>### is_lmstudio@@ -598,6 +608,16 @@ def is_openrouter(self):Returns whether this platform is openrouter.+<a id="camel.types.enums.ModelPlatformType.is_orcarouter"></a>++### is_orcarouter++```python+def is_orcarouter(self):+```++Returns whether this platform is orcarouter.+<a id="camel.types.enums.ModelPlatformType.is_lmstudio"></a>### is_lmstudiodiff --git a/docs/mintlify/reference/camel.types.unified_model_type.mdx b/docs/mintlify/reference/camel.types.unified_model_type.mdxindex a7237311f..d10b53223 100644--- a/docs/mintlify/reference/camel.types.unified_model_type.mdx+++ b/docs/mintlify/reference/camel.types.unified_model_type.mdx@@ -149,6 +149,16 @@ def is_openrouter(self):Returns whether the model is a OpenRouter served model.+<a id="camel.types.unified_model_type.UnifiedModelType.is_orcarouter"></a>++### is_orcarouter++```python+def is_orcarouter(self):+```++Returns whether the model is a OrcaRouter served model.+<a id="camel.types.unified_model_type.UnifiedModelType.is_avian"></a>### is_avian