Objetivo
Section titled “Objetivo”Conseguir que greetings, smalltalk, prompts cortos y observe básico vayan SIEMPRE a llama-3.1-8b, reservando qwen2.5-coder-14b solo para coding, architecture, reasoning y debugging.
Problema detectado
Section titled “Problema detectado”Tras FASE 29.3 (three-model runtime), se detectó que saludos como “adios”, “vale”, “genial”, “perfecto” y prompts triviales como “si”, “no”, “claro” seguían activando qwen2.5-14b innecesariamente. El is_greeting_request() solo reconocía 11 marcadores exactos.
Solución
Section titled “Solución”Greeting Fastpath (48 marcadores)
Section titled “Greeting Fastpath (48 marcadores)”_GREETING_MARKERS = ( "hola", "buenas", "adios", "gracias", "ok", "vale", "genial", "perfecto", "claro", "entendido", "si", "no", "de acuerdo", "hello", "hi", "thanks", "bye", "yes", "yeah", "nope", ...)48 marcadores cubriendo español e inglés. Token-based fallback con len(tokens) <= 1 para detectar cualquier saludo corto no listado.
Lightweight Prompt Heuristic
Section titled “Lightweight Prompt Heuristic”def is_lightweight_prompt(text: str) -> bool: if len(text) < 120 and no code_fences and no_architecture_keywords: return True # → llama-3.1-8bQWEN_ESCALATION_REASONS
Section titled “QWEN_ESCALATION_REASONS”9 razones deterministas para activar qwen2.5-14b:
| Razón | Disparador |
|---|---|
coding_explicit | Code fences, function writing |
architecture_deep | Multi-step analysis keywords |
debugging | Stacktrace, traceback, exception |
long_context | Prompt > 500 chars técnico |
multi_step | Multi-file planning |
reasoning_deep | ”analiza”, “razona”, “compara” |
report_technical | ”informe”, “report”, “documentación” |
Observe Override Fix
Section titled “Observe Override Fix”El observe fastpath forzaba llama incluso para análisis profundos. Corregido: si get_qwen_escalation_reason() detecta motivo de escalada, el observe no fuerza llama.
Validación
Section titled “Validación”13/13 tests PASS:
- Todos los greetings → llama ✅
- Coding → qwen2.5 ✅
- Architecture → qwen2.5 ✅
- Short trivia → llama ✅
Métricas nuevas
Section titled “Métricas nuevas”ailab_greeting_fastpath_totalailab_qwen_escalation_totalailab_llama_fastpath_total