regolo/brick-complexity-2-max
18
1---2library_name: peft3license: cc-by-nc-4.04language:5 - en6tags:7 - peft8 - safetensors9 - lora10 - complexity-classification11 - llm-routing12 - query-difficulty13 - brick14 - text-classification15 - semantic-router16 - inference-optimization17 - cost-reduction18 - reasoning-budget19base_model: Qwen/Qwen3.5-0.8B20pipeline_tag: text-classification21---22 23<div align="center">24 25# Brick Complexity Classifier v2: `max`26 27</div>28 29## What is this?30 31Classifier v2 is a family of small adapters that score each incoming prompt as **`easy` / `medium` / `hard`**, so a router can send it to the right tier of a model pool. Two variants optimize for different goals:32 33- **`eco`**: optimized for **cost**. Biases predictions toward `easy` so most traffic stays on the cheap tier. Use when the cost-per-query bill matters more than squeezing the last accuracy point.34- **`max`**: optimized for **routing accuracy**. Gives the sharpest easy/medium/hard split, so hard queries reliably reach the strongest tier and easy ones stay cheap. Use when answer quality is paramount.35 36<div align="center">37 38Maximum-accuracy variant tuned to classify query complexity as precisely as possible. Prioritizes routing quality over cost.39 40**[Regolo.ai](https://regolo.ai) | [Brick SR1 on GitHub](https://github.com/regolo-ai/brick-SR1)**41 42[](https://creativecommons.org/licenses/by-nc/4.0/)43[](https://huggingface.co/Qwen/Qwen3.5-0.8B)44 45</div>46 47---48 49## Model Details50 51| Property | Value |52|---|---|53| **Variant** | `max` |54| **Target** | Best classification accuracy, maximum routing quality |55| **Base model** | [Qwen/Qwen3.5-0.8B](https://huggingface.co/Qwen/Qwen3.5-0.8B) |56| **Adapter type** | LoRA (r=32, α=32, dropout=0.1) |57| **Output classes** | 3 (`easy`, `medium`, `hard`) |58| **License** | CC BY-NC 4.0 |59 60## Available Formats61 62| Format | Link |63|---|---|64| LoRA adapter | [regolo/brick-complexity-2-max](https://huggingface.co/regolo/brick-complexity-2-max) |65| GGUF BF16 | [regolo/brick-complexity-2-max-BF16-GGUF](https://huggingface.co/regolo/brick-complexity-2-max-BF16-GGUF) |66| GGUF Q8_0 | [regolo/brick-complexity-2-max-Q8_0-GGUF](https://huggingface.co/regolo/brick-complexity-2-max-Q8_0-GGUF) |67| GGUF Q4_K_M | [regolo/brick-complexity-2-max-Q4_K_M-GGUF](https://huggingface.co/regolo/brick-complexity-2-max-Q4_K_M-GGUF) |68 69## Usage (PEFT)70 71```python72from peft import PeftModel73from transformers import AutoModelForCausalLM, AutoTokenizer74import torch75 76base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-0.8B", torch_dtype=torch.bfloat16)77tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.5-0.8B")78model = PeftModel.from_pretrained(base, "regolo/brick-complexity-2-max").eval()79 80system = """You are a query difficulty classifier for an LLM routing system.81Classify each query as easy, medium, or hard based on the cognitive depth and domain expertise required to answer correctly.82Respond with ONLY one word: easy, medium, or hard."""83prompt = f"<|im_start|>system\n{system}<|im_end|>\n<|im_start|>user\nClassify: Design a distributed consensus algorithm<|im_end|>\n<|im_start|>assistant\n"84ids = tok(prompt, return_tensors="pt").input_ids85out = model.generate(ids, max_new_tokens=3, do_sample=False)86print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True).strip())87# Output: hard88```89 90## Usage (vLLM)91 92```python93from vllm import LLM, SamplingParams94from vllm.lora.request import LoRARequest95 96llm = LLM(97 model="Qwen/Qwen3.5-0.8B",98 enable_lora=True,99 max_lora_rank=32,100 dtype="bfloat16",101)102sp = SamplingParams(temperature=0, max_tokens=3)103 104system = """You are a query difficulty classifier for an LLM routing system.105Classify each query as easy, medium, or hard based on the cognitive depth and domain expertise required to answer correctly.106Respond with ONLY one word: easy, medium, or hard."""107prompt = f"<|im_start|>system\n{system}<|im_end|>\n<|im_start|>user\nClassify: Explain the rendering equation from radiometric first principles<|im_end|>\n<|im_start|>assistant\n"108 109out = llm.generate(110 [prompt],111 sp,112 lora_request=LoRARequest("brick-complexity-2-max", 1, "regolo/brick-complexity-2-max"),113)114print(out[0].outputs[0].text.strip())115# Output: hard116```117 118## About Brick119 120[Regolo.ai](https://regolo.ai) is the EU-sovereign LLM inference platform built on [Seeweb](https://www.seeweb.it/) infrastructure. **Brick** is our open-source semantic routing system that intelligently distributes queries across model pools, optimizing for cost, latency, and quality.121 122**[Website](https://regolo.ai) | [Docs](https://docs.regolo.ai) | [GitHub](https://github.com/regolo-ai) | [Discord](https://discord.gg/myuuVFcfJw)**123 