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.

Auto (Configurable Model Routing)

Auto routes each request to whichever of your own already-connected models best fits it, instead of you picking one model for every task. It appears as an Auto card on the Models page's LLM tab.

  1. Open Configure Auto and choose one or more candidate models from the LLMs you have already connected.
  2. Map each candidate to a matching routing profile. Each routing profile can only be mapped to one candidate.
  3. Optionally choose a fallback model — used only if routing itself fails, and it must be one of your selected candidates.
  4. Optionally set Auto as your default model, so new tasks start with it unless you pick another model explicitly.

Uses your own credentials

Auto does not need a separate credential. It reuses each selected candidate's own provider, API key, and base URL — routing only chooses which of your connected models handles a given request.

A model in use by Auto can't be repurposed while it's referenced

You can't delete a model, or change it into a non-LLM model, while an Auto configuration is using it as a candidate or fallback — remove it from the Auto configuration first.

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 Tokens—Maximum 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