LLM Models
Large Language Models are the core intelligence behind Xagent, handling reasoning, planning, and text generation. Different LLM roles can be filled by different models.
LLM Roles
Main Model
The primary LLM used for all task execution by default — planning, decomposition, tool selection, and decision-making. Required.
Recommended: Claude 4.6 Sonnet (balanced), Claude 4.6 Opus (complex tasks), GPT 5.2, Gemini 3 Pro.
Fast Model (Optional)
A lightweight LLM used for steps the planner identifies as simple. If not configured, the main model handles every step. Automatic routing requires no manual intervention and reduces cost and latency for routine operations.
Long Context Model (Compact)
Compresses conversation history when it exceeds the compact threshold, preserving the original goal, key information, and critical context so long-running tasks do not hit context limits.
| Option | Description |
|---|---|
| Threshold | Token limit that triggers compaction (default 32,000). Adjustable per task or agent. |
| Fallback | If compaction fails, Xagent truncates to recent messages while keeping system messages. |
Vision Model (Optional)
A multimodal LLM that analyses images alongside text. Enables the image tools understand_images, describe_images, and detect_objects for screenshot interpretation, OCR, and chart analysis.
Model Parameters
| Parameter | Range | Guidance |
|---|---|---|
| Temperature | 0.0 – 2.0 | 0.0–0.3 deterministic; 0.4–0.7 balanced; 0.8+ creative. Main model 0.3–0.5. |
| Max Tokens | — | Maximum response length. Balance detail against token cost. |
| Top P | 0.0 – 1.0 | Alternative to temperature; lower is more focused. |
Supported Providers
| Provider | Models | Best for |
|---|---|---|
| OpenAI & compatible | GPT 5.x | General-purpose, wide ecosystem. |
| Anthropic | Claude 4.6 (Opus, Sonnet, Haiku) | Complex reasoning, long context. |
| Gemini 3 Pro | Large context windows, multimodal. | |
| Xinference | Open-source LLMs (Llama, Mistral, Qwen) | Privacy, cost control, self-hosting. |
Credentials
For OpenAI, Anthropic, and Google, just enter the API key. A Base URL is only needed for OpenAI-compatible services or self-hosted models (e.g. Xinference).
Adding an LLM
- Go to Models in the sidebar and add a provider.
- Enter the API key (and Base URL for compatible/self-hosted endpoints).
- Xagent fetches available models — pick one and assign its role.
- Configure parameters, test the connection, and set as default.