regolo/brick-complexity-extractor
<div align="center">
π§± Brick Complexity Extractor
A lightweight LoRA adapter for real-time query complexity classification
[Regolo.ai](https://regolo.ai) Β· [Dataset](https://huggingface.co/datasets/regolo/brick-complexity-extractor) Β· [Brick SR1 on GitHub](https://github.com/regolo-ai/brick-SR1) Β· [API Docs](https://docs.regolo.ai)
  
</div>
Table of Contents
- Overview
- The Problem: Why LLM Routing Needs Complexity Classification
- Model Details
- Architecture
- Label Definitions
- Performance
- Quick Start
- GGUF Quantized Models
- Integration with Brick Semantic Router
- Intended Uses
- Limitations
- Training Details
- Environmental Impact
- Citation
- About Regolo.ai
Overview
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.
<img src="https://cdn-uploads.huggingface.co/production/uploads/66e9a629df006ca4588b82bd/ZoRBcn8rD8sTEHdkiczOO.png" alt="brick_router" width="800">
Model Details
Architecture
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)Label Definitions
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)
Per-Class Performance
Latency
Quick Start
Installation
pip install peft transformers torchInference
from peft import PeftModel
from transformers import AutoModelForSequenceClassification, AutoTokenizer
# Load base model + adapter
base_model_id = "Qwen/Qwen3.5-0.8B"
adapter_id = "regolo/brick-complexity-extractor"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
model = AutoModelForSequenceClassification.from_pretrained(
base_model_id, num_labels=3
)
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
# Classify a query
query = "Explain the difference between TCP and UDP"
inputs = tokenizer(query, return_tensors="pt", truncation=True, max_length=512)
outputs = model(**inputs)
labels = ["easy", "medium", "hard"]
predicted = labels[outputs.logits.argmax(dim=-1).item()]
print(f"Complexity: {predicted}")
# Output: Complexity: mediumUsing with vLLM (recommended for production)
# The adapter can be loaded as a LoRA module in vLLM
# See Brick SR1 documentation for full integration guide
# https://github.com/regolo-ai/brick-SR1GGUF 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:
See the brick-complexity-extractor collection for all available formats.
Integration with Brick Semantic Router
Brick Complexity Extractor is designed to work as a signal within the Brick Semantic Router pipeline. In a typical deployment:
- Query arrives at the Brick router endpoint
- Parallel signal extraction runs complexity classification alongside keyword matching, domain detection, and reasoning estimation
- Routing decision combines all signals to select the optimal model from the pool
- Query forwarded to the chosen model (e.g., Qwen 7B for easy, Llama 70B for medium, Claude for hard)
# Brick router configuration example (brick-config.yaml)
signals:
complexity:
model: regolo/brick-complexity-extractor
weight: 0.35
domain:
model: regolo/brick-domain-classifier # coming soon
weight: 0.25
keyword:
type: rule-based
weight: 0.20
reasoning:
type: heuristic
weight: 0.20
model_pools:
easy:
- qwen3.5-7b
- llama-3.3-8b
medium:
- qwen3.5-32b
- llama-3.3-70b
hard:
- claude-sonnet-4-20250514
- deepseek-r1Intended Uses
β Primary Use Cases
- 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
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.
Citation
@misc{regolo2026brick-complexity,
title = {Brick Complexity Extractor: A LoRA Adapter for Query Complexity Classification in LLM Routing},
author = {Regolo.ai Team},
year = {2026},
url = {https://huggingface.co/regolo/brick-complexity-extractor}
}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.
<div align="center">
[Website](https://regolo.ai) Β· [Docs](https://docs.regolo.ai) Β· [Discord](https://discord.gg/myuuVFcfJw) Β· [GitHub](https://github.com/regolo-ai) Β· [LinkedIn](https://www.linkedin.com/company/regolo-ai/)
</div>
