Documentation
Routing

Model Routing

A deep dive into how ARKAbrain selects the optimal model for each request through classification, complexity assessment, and intelligent fallbacks.

Routing Overview

When you send a request to ARKA-AI, ARKAbrain performs a multi-step routing process to select the best model. This process considers your task type, input complexity, available providers, and plan tier.

Routing Pipeline

InputClassifyAssess ComplexitySelect RoleChoose ModelExecute

Task Classification

The first step is identifying what type of task you're performing. ARKAbrain uses a two-stage classifier:

Stage 1: Heuristics

Fast pattern matching using regex rules. Detects keywords like "summarize", "rewrite", "explain", etc. with weighted confidence scores.

Stage 2: LLM Fallback

If heuristics have low confidence (<70%), a lightweight LLM call provides more accurate classification.

The main task types are below. ARKAbrain also recognizes fast coding questions, architecture and refactoring, structured JSON, deep reasoning, and comparisons, which route to the CODING, ARCHITECTURE, JSON_STRUCTURED and REASONING roles:

Task TypeDetection Patterns
rewrite_editingrewrite, rephrase, improve, polish, make better
summarizationsummarize, tl;dr, key points, condense
explain_simpleexplain, ELI5, break down, simplify
seo_marketingSEO, meta description, title tag, marketing
prompt_optimizationimprove prompt, prompt engineering, optimize
coding_debuggingcode blocks, error, debug, implement, function
general_chatFallback for unclassified requests

Complexity Assessment

After identifying the task type, ARKAbrain assesses the complexity of your request. This determines whether to use a fast/cheap model or a powerful/premium one.

Low Complexity

  • • Short input (<100 tokens)
  • • Keywords: "simple", "quick", "brief", "just"
  • • No code blocks

Medium Complexity

  • • Moderate input (100-500 tokens)
  • • Keywords: "explain", "describe", "outline"
  • • One code block

High Complexity

  • • Long input (>500 tokens)
  • • Keywords: "complex", "detailed", "comprehensive"
  • • Multiple code blocks

Role Selection Matrix

Based on task type and complexity, ARKAbrain assigns a model role. Each role has a primary model and fallback chain:

TaskLowMediumHigh
Rewrite/EditFAST_CHEAPBALANCEDBALANCED
SummarizeFAST_CHEAPFAST_CHEAPBALANCED
ExplainFAST_CHEAPBALANCEDBALANCED
SEO/MarketingBALANCEDSEO_WRITERSEO_WRITER
PromptsBALANCEDREASONINGREASONING
CodingFAST_CHEAPCODINGCODING
GeneralFAST_CHEAPBALANCEDBALANCED

Model Registry

ARKAbrain maintains a registry of 12 current models: four from OpenAI (used directly with your OpenAI key) and eight from Anthropic, Google, DeepSeek, Mistral and xAI (used through OpenRouter). Each model is configured with its capabilities, costs, and strengths. Older model IDs, such as GPT-4o or Claude 3.5 Sonnet, are automatically redirected to their current successors.

ModelProviderContextSpeedStrengths
GPT-6.2 AstraOpenAI1MSlowComplex reasoning, Coding, Analysis
GPT-6.2 SolOpenAI1MMediumGeneral, Coding, Structured output
GPT-6.1 TerraOpenAI1MMediumGeneral, Writing
GPT-6 LunaOpenAI1MFastFast, Cheap, General
Claude Opus 5.5OpenRouter1MSlowComplex reasoning, Architecture
Claude Sonnet 5.5OpenRouter1MMediumCoding, Writing
Claude Haiku 5.5OpenRouter1MFastFast, Cheap, General
Gemini 4 ArgonOpenRouter1MMediumReasoning, Long context
Gemini 3.8 FlashOpenRouter1MFastFast, Long context
DeepSeek V4.1 FlashOpenRouter1MFastCheap, Coding
Mistral Large 4OpenRouter1MMediumStructured output, Writing
Grok 4.7OpenRouter500KMediumCoding, Reasoning

Fallback Chains

Each role has a primary model and a chain of fallbacks. If the primary model fails (rate limit, error, etc.), ARKAbrain automatically tries the next model in the chain. Models from a provider you haven't added a key for are skipped, and on a team workspace only the team's approved models are used:

FAST_CHEAP
GPT-6 Luna→Claude Haiku 5.5→DeepSeek V4.1 Flash→Gemini 3.8 Flash
BALANCED
GPT-6.1 Terra→Claude Sonnet 5.5→GPT-6.2 Sol→Gemini 3.8 Flash→Mistral Large 4
REASONING
Claude Opus 5.5→GPT-6.2 Sol→Gemini 4 Argon→Claude Sonnet 5.5
CODING
Claude Sonnet 5.5→GPT-6.2 Sol→Grok 4.7→GPT-6.1 Terra→DeepSeek V4.1 Flash
ARCHITECTURE
Claude Opus 5.5→GPT-6.2 Sol→Gemini 4 Argon→Claude Sonnet 5.5
JSON_STRUCTURED
GPT-6.2 Sol→GPT-6.1 Terra→Mistral Large 4→Claude Sonnet 5.5
LONG_CONTEXT
Gemini 4 Argon→Claude Sonnet 5.5→GPT-6.1 Terra→Gemini 3.8 Flash
SEO_WRITER
Claude Sonnet 5.5→Claude Opus 5.5→GPT-6.1 Terra→Mistral Large 4

Temperature Tuning

ARKAbrain sets optimal temperature for each task type. Lower temperature means more focused output; higher means more creative:

Task TypeTemperature RangeWhy
Coding/Debugging0.1 - 0.3Precision is critical
Summarization0.2 - 0.3Accuracy over creativity
Rewrite/Edit0.2 - 0.4Preserve meaning
Prompt Optimization0.3 - 0.5Balance precision and exploration
Explain Simply0.4 - 0.6Allow creative analogies
General Chat0.5 - 0.7Natural conversation
SEO/Marketing0.6 - 0.8Encourage creativity

Plan-Based Routing

Your subscription plan affects which roles are available:

Free Plan (and legacy Starter)

  • FAST_CHEAP role
  • BALANCED role
  • REASONING → BALANCED
  • CODING → BALANCED
  • ARCHITECTURE → BALANCED
  • JSON_STRUCTURED → BALANCED
  • LONG_CONTEXT → BALANCED
  • SEO_WRITER → BALANCED

Pro, Team and Team Plus

  • FAST_CHEAP role
  • BALANCED role
  • REASONING role (Claude Opus 5.5)
  • CODING role (Claude Sonnet 5.5)
  • ARCHITECTURE and JSON_STRUCTURED roles
  • LONG_CONTEXT role (Gemini 4 Argon)
  • SEO_WRITER role

Automatic Downgrades

On the Free plan, premium roles are automatically routed to BALANCED, which uses GPT-6.1 Terra, a strong all-around model.