Which LLM calls are candidates for replacement?
A call that returns only a label, yes/no decision or fixed rating can be evaluated with JevStyle's local typed decision models. Keep generative LLM calls when the application needs a drafted answer, explanation or flexible extraction. For stable labels with training examples, include a supervised classifier as the baseline. Replacement is justified by held-out results and total workflow behavior, not parameter count alone.
JevStyle does not generate a chat completion. You change the decision step to a typed request and validate the returned scores; it is not a drop-in substitute for every OpenAI-compatible chat endpoint.
Translate the output contract into named choices
A prompt such as “Return billing, shipping or account and nothing else” hides its allowed outputs in text. Make those labels explicit, describe each route, add an out-of-scope option, and keep the final test examples separate from the prompt-design process.
from jev_style import JevStyle, choice
routes = {"billing": "Charges, invoices and refunds",
"shipping": "Tracking, parcels and delivery",
"account": "Login, passwords and account access",
"other": "Requests outside those workflows"}
with JevStyle(base_url="http://127.0.0.1:8765", api_key="") as model:
result = model.decide(
"I was charged twice for one order.",
{"route": choice("Which workflow should review this request?", routes)},
)
print(result["answers"]["route"]["probabilities"])Start jev-style serve --release 0.8b first, using jev-style[mlx]==0.6.2 on Apple silicon or jev-style[torch]==0.6.2 for CPU/CUDA. The returned probabilities are model outputs, not verified correctness rates. Validate finite scores, exact option keys and runtime errors before considering any route. See the full Python classifier with error handling.
Choose the acceptance threshold on development data
For each development example, store the predicted label, actual label, top option probability and whether inference failed. Select a threshold under a task-specific error budget, then freeze it before final testing. The largest option probability is different from the API's normalized confidence field; do not tune one field and deploy the other.
For every proposed threshold report: accepted requests divided by all requests; wrong accepted predictions divided by accepted labeled requests; counts per route; and unknown/failed requests. A threshold of 0.90 does not guarantee 90% accuracy. Low-confidence, out-of-scope and failed requests go to the existing LLM or a human.
The evaluation guide covers calibration and coverage. The complete fallback recipe measures a primary local server and an optional second systemone-compatible server. Adapting it to a different LLM API requires that API's own client; compatibility should not be assumed.
Measure the full replacement, including fallback
| Record | Why it matters |
|---|---|
| Model revision, backend, precision and hardware | Results are specific to the actual execution configuration |
| Error per label and accepted-request error | A good average can hide failures on a critical route |
| Coverage and fallback frequency | Sending many requests to review can remove the expected benefit |
| Cold startup, warm latency and complete request latency | Model-only timing omits queueing, serialization and fallback |
| Observed hosted calls and actual billed cost | Fewer fallback calls is not by itself a cost-saving measurement |
| Privacy boundary | A remote fallback can receive text even if the primary runs locally |
Use a shadow phase that records proposals without dispatching actions. Proceed only if the frozen acceptance rule meets the measured requirements on a separate held-out set. Keep rollback and error-to-review behavior available.
Evidence and runnable entry points
The source recipes include synthetic support tickets for workflow checks. They are not a production benchmark. The published model evaluations are project self-runs with explicit protocols and do not establish your application's savings or accuracy.
Related: Compare named local tools · Build the routing boundary · Review tool calls locally.