Brick Complexity Extractor is a LoRA adapter fine-tuned on Qwen3.5-0.8B that classifies user queries into three complexity tiers: easy, medium, and hard. It is a core signal in the Brick Semantic Router, Regolo.ai's open-source multi-model routing system.
The adapter adds only ~2M trainable parameters on top of the 0.8B base model, making it fast enough to run as a pre-inference classification step with negligible latency overhead (<15ms on a single GPU).
The Problem: Why LLM Routing Needs Complexity Classification
Not all prompts are equal. A factual recall question ("What is the capital of France?") and a multi-step reasoning task ("Derive the optimal portfolio allocation given these constraints…") require fundamentally different compute budgets. Sending every query to a frontier reasoning model wastes resources; sending hard queries to a lightweight model degrades quality.
Brick solves this by routing each query to the right model tier in real time. Complexity classification is one of several routing signals (alongside keyword matching, domain detection, and reasoning-depth estimation) that Brick uses to make sub-50ms routing decisions.
The adapter applies LoRA to the query and value projection matrices (q_proj, v_proj) across all attention layers of Qwen3.5-0.8B, with a classification head on top of the last hidden state.
Qwen3.5-0.8B (frozen)
└── Attention Layers × 24
├── q_proj ← LoRA(r=16, α=32)
└── v_proj ← LoRA(r=16, α=32)
└── Last Hidden State
└── Classification Head (3 classes)
"Compare REST and GraphQL for a mobile app backend"
hard
6+
Deep expertise, multi-constraint optimization, creative synthesis
"Design a distributed cache eviction policy that minimizes tail latency under bursty traffic"
Labels were generated by Qwen3.5-122B acting as an LLM judge on 76,831 diverse user prompts. See the dataset card for full labeling methodology.
Performance
Classification Metrics (Test Set — 3,841 samples)
Metric
Value
Accuracy
89.2%
Weighted F1
87.4%
Macro F1
85.1%
Per-Class Performance
Class
Precision
Recall
F1
Support
easy
0.92
0.94
0.93
1,057
medium
0.88
0.90
0.89
1,660
hard
0.84
0.79
0.81
519
Latency
Setup
Inference Time (p50)
Inference Time (p99)
NVIDIA A100 (bf16)
8ms
14ms
NVIDIA L4 (fp16)
12ms
22ms
CPU (Intel Xeon, fp32)
45ms
78ms
Quick Start
Installation
pip install peft transformers torch
Inference
python
1from peft import PeftModel
2from transformers import AutoModelForSequenceClassification, AutoTokenizer
34# Load base model + adapter5base_model_id ="Qwen/Qwen3.5-0.8B"6adapter_id ="regolo/brick-complexity-extractor"78tokenizer = AutoTokenizer.from_pretrained(base_model_id)9model = AutoModelForSequenceClassification.from_pretrained(10 base_model_id, num_labels=311)12model = PeftModel.from_pretrained(model, adapter_id)13model.eval()1415# Classify a query16query ="Explain the difference between TCP and UDP"17inputs = tokenizer(query, return_tensors="pt", truncation=True, max_length=512)18outputs = model(**inputs)1920labels =["easy","medium","hard"]21predicted = labels[outputs.logits.argmax(dim=-1).item()]22print(f"Complexity: {predicted}")23# Output: Complexity: medium
Using with vLLM (recommended for production)
python
1# The adapter can be loaded as a LoRA module in vLLM2# See Brick SR1 documentation for full integration guide3# https://github.com/regolo-ai/brick-SR1
GGUF Quantized Models
Pre-built GGUF files are available for inference with llama.cpp, Ollama, LM Studio, vLLM, and other GGUF-compatible runtimes. Each quantization is published as a separate model:
LLM routing: Classify query complexity to route to the optimal model tier, reducing inference cost by 30–60% compared to always-frontier routing
Reasoning budget allocation: Decide how many reasoning tokens to allocate before inference begins
Traffic shaping: Balance GPU load across model pools based on real-time complexity distribution
Cost monitoring: Track complexity distribution over time to optimize fleet sizing
⚠️ Out-of-Scope Uses
Content moderation or safety filtering — this model classifies cognitive difficulty, not content safety
Non-English queries trained on English data only; accuracy degrades significantly on other languages
Direct use as a chatbot or generative model this is a classification adapter, not a generative model
Limitations
Label noise: The training labels were generated by Qwen3.5-122B, not human annotators. While LLM-as-judge achieves high inter-annotator agreement on complexity, systematic biases may exist (e.g., overweighting mathematical content as "hard")
Class imbalance: The "hard" class represents only 13.5% of training data, which may lead to lower recall on genuinely hard queries
Domain coverage: The training set covers general-purpose user prompts. Specialized domains (medical, legal, financial) may exhibit different complexity distributions
English only: No multilingual support in this version
Adversarial robustness: The model has not been tested against adversarial prompt manipulation designed to fool the complexity classifier
Training Details
Hyperparameter
Value
Base model
Qwen/Qwen3.5-0.8B
LoRA rank (r)
16
LoRA alpha (α)
32
LoRA dropout
0.05
Target modules
q_proj, v_proj
Learning rate
2e-4
Batch size
32
Epochs
3
Optimizer
AdamW
Scheduler
Cosine with warmup (5% steps)
Max sequence length
512 tokens
Training samples
65,307
Validation samples
7,683
Test samples
3,841
Training hardware
1× NVIDIA A100 80GB
Training time
~2 hours
Framework
PyTorch + HuggingFace PEFT
Environmental Impact
Regolo.ai is committed to sustainable AI. This model was trained on GPU infrastructure powered by Seeweb's data centers in Italy, which run on certified renewable energy.
Metric
Value
Hardware
1× NVIDIA A100 80GB
Training duration
~2 hours
Estimated CO₂
< 0.5 kg CO₂eq
Energy source
Renewable (certified)
Location
Italy (EU)
Citation
bibtex
1@misc{regolo2026brick-complexity,
2 title = {Brick Complexity Extractor: A LoRA Adapter for Query Complexity Classification in LLM Routing},
3 author = {Regolo.ai Team},
4 year = {2026},
5 url = {https://huggingface.co/regolo/brick-complexity-extractor}
6}
About Regolo.ai
Regolo.ai is the EU-sovereign LLM inference platform built on Seeweb infrastructure. We provide zero-data-retention, GDPR-native AI inference for enterprises that need privacy, compliance, and performance all from European data centers powered by renewable energy.
Brick is our open-source semantic routing system that intelligently distributes queries across model pools, optimizing for cost, latency, and quality.