Downshift
← All call sites

supportdesk/misc_utils.py:25

lang_of

found by Bobeasyexacttextmax_tokens 5temperature 0

Detect the language of a support ticket and return the ISO 639-1 two-letter code.

Output contract

Exactly one two-letter lowercase ISO 639-1 code (e.g. 'en', 'es', 'fr'); no punctuation, no extra words; caller takes only the first two characters of the response.

downgradeqwen2.5:7b → qwen2.5:1.5b

keeps 100% of baseline quality and costs less

$174.34
Before / month
$10.46
After / month
$163.88
Savings (94.0%)
20,000
Calls / day

Dollar figures are projections: measured token counts x illustrative per-model prices x an assumed call volume, all set in downshift.yaml. They are not a real bill.

Models

How each model did

ModelPass rateTokens in / outLatencyCost / callvs baselineCheck
qwen2.5:7bbaseline
premium tier
90.9% (20/22)108 / 20.43 s$0.000291n/an/a
qwen2.5:3b
standard tier
81.8% (18/22)108 / 20.19 s$0.00004690.0%fail
qwen2.5:1.5bchosen
budget tier
90.9% (20/22)108 / 20.14 s$0.000017100.0%pass
qwen2.5:0.5b
nano tier
81.8% (18/22)108 / 20.06 s$0.00001290.0%fail

Prompt

What the call sends

Model in code: qwen2.5:7b

user
Which language is this text written in? Reply with the two-letter ISO 639-1 code only (for example: en, es, fr). Text: {text}

Eval examples

3 of 22 cases, every model side by side

›lng-017b3b1.5b0.5b

Inputs

text
Refund request for ORD-10421 Hi, I ordered a pair of wireless headphones on 2026-09-02 (order ORD-10421). They're unused and still in the box, but I changed my mind. Can I get a refund?

Expected

en

standard English ticket (T001)

Outputs

qwen2.5:7bpass
en

match

qwen2.5:3bpass
en

match

qwen2.5:1.5bpass
en

match

qwen2.5:0.5bpass
en

match

›lng-027b3b1.5b0.5b

Inputs

text
Solicitud de reembolso Hola, compré una lámpara (pedido ORD-10812) el 2026-07-30 y llegó rota. ¿Pueden devolverme el dinero?

Expected

es

Spanish refund request (T006)

Outputs

qwen2.5:7bpass
es

match

qwen2.5:3bpass
es

match

qwen2.5:1.5bpass
es

match

qwen2.5:0.5bpass
es

match

›lng-037b3b1.5b0.5b

Inputs

text
Colis non reçu Bonjour, ma commande ORD-10905 du 2026-09-10 n'est toujours pas arrivée. Pouvez-vous vérifier ?

Expected

fr

French non-delivery inquiry (T007)

Outputs

qwen2.5:7bpass
fr

match

qwen2.5:3bpass
fr

match

qwen2.5:1.5bpass
fr

match

qwen2.5:0.5bpass
fr

match

All cases

Pass and fail across all 22 cases

qwen2.5:7b
20/22
qwen2.5:3b
18/22
qwen2.5:1.5b
20/22
qwen2.5:0.5b
18/22
pass fail no resultHover a square for the case id.