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.

OptionDescription
ThresholdToken limit that triggers compaction (default 32,000). Adjustable per task or agent.
FallbackIf 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

ParameterRangeGuidance
Temperature0.0 – 2.00.0–0.3 deterministic; 0.4–0.7 balanced; 0.8+ creative. Main model 0.3–0.5.
Max TokensMaximum response length. Balance detail against token cost.
Top P0.0 – 1.0Alternative to temperature; lower is more focused.

Supported Providers

ProviderModelsBest for
OpenAI & compatibleGPT 5.xGeneral-purpose, wide ecosystem.
AnthropicClaude 4.6 (Opus, Sonnet, Haiku)Complex reasoning, long context.
GoogleGemini 3 ProLarge context windows, multimodal.
XinferenceOpen-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

  1. Go to Models in the sidebar and add a provider.
  2. Enter the API key (and Base URL for compatible/self-hosted endpoints).
  3. Xagent fetches available models — pick one and assign its role.
  4. Configure parameters, test the connection, and set as default.

Next Steps