Upgrades the routing engine to support tag, token limit, multimodal, reasoning, and tool calling conditions. Adds unit tests for the new routing features.
Classifier: When complexity_threshold is set (e.g. 10), uses it as the
rating scale and maps ratings proportionally to target buckets instead
of 1:1. Formula: idx = rating * len(targets) / (threshold + 1).
With threshold=10 and 3 targets: 1-3→target[0], 4-7→target[1], 8-10→target[2].
Seed: Added 'dispatcher' group (classifier, threshold=10, selector=deepseek-v4-flash)
that auto-routes to fast-flow/standard-pro/heavy-logic by complexity score.
Combined with hierarchical routing, this enables two-level dispatch:
dispatcher scores 1-10 → routes to tier group → tier picks concrete model.
Schema: Added logic_level (INTEGER) and primary_use (TEXT) columns
to model_groups table with auto-migration for existing databases.
Seed: Three new default groups:
heavy-logic (level 9) — Complex Coding, Logic, Agents
standard-pro (level 5) — General Assistant, Long Docs
fast-flow (level 2) — Classification, JSON, Basic Q&A
Admin API: INSERT/UPDATE handlers now accept and persist the new fields.
Dashboard: Table shows Level and Primary Use columns; form includes
both fields with appropriate inputs and placeholders.
Added JSON tags to the User struct to match frontend expectations and excluded sensitive fields.
Updated session management to include and persist DisplayName.
Unified user field names (using display_name) across backend, sessions, and frontend UI.