TypeSafe (jev)
Set up TypeSafe's jev classifier for find re-ranking, skill suggestions, error triage and tool picks: how to turn each on, its cost, and its limits.
Copy & share
On this page8 sections
TypeSafe is a separate service, and jev is its classifier model. A classifier does not write text. You give it some context and a question with named options, and it tells you how likely each option is.
Empryo can use jev for a few small decisions, such as reordering find results or suggesting a skill you have installed. Every feature is off by default. Read the measurements and method before you turn any of them on.
Get a keyLink to this section
Create an API key at typesafe.ai.
In the terminal UI, run /typesafe to open the TypeSafe panel. The first row is the API key: press Enter on it, paste the key, and press Enter again. The key is saved as the typesafe-api-key secret, in your operating system's keychain when one is available. All the switches below are in the same panel.
/websearch is a different command. It turns the web search tool on or off.
In the desktop app, open Settings and pick TypeSafe. Paste the key into the field marked TYPESAFE_API_KEY and save.
You can also set an environment variable before you start Empryo:
export TYPESAFE_API_KEY=apikey_...Turn it onLink to this section
In the terminal UI, /typesafe lists every switch under the key row. Press Enter to flip the one under the cursor:
- Use TypeSafe is the main switch. When it is off, Empryo never calls TypeSafe.
- Search re-rank reorders the results of the
findtool. - Re-rank mode is
shadoworapply(see below). - Skill suggestion picks at most one of your installed skills per turn that fits the request.
- Error triage takes a second look at a failed model call, once, just before the turn would end.
- Tool pick works on models that load tools only when needed. It names the tool a request is likely to need and adds that name as a note to the turn. The tool itself is not loaded. This sends your request text to jev.
shadow is the default re-rank mode. Empryo works out the new order and its cost and shows the result in the chat, but the model still gets the original order. This lets you see what re-ranking would do before you trust it. apply gives the model the new order.
The desktop app uses the same names in its TypeSafe settings section.
Each feature needs three things: its own switch, the main switch, and an API key.
Error triageLink to this section
When a model call fails, Empryo reads the provider's error message and decides what to do: try again, shorten the conversation and resend, or end the turn. It does this by matching known error wordings. Providers word their errors differently and change them over time, so sometimes a message is not recognized.
With Error triage on, jev is asked only at one moment: when the pattern matching has decided the failure is permanent and the turn is about to end. If jev says the error is really a context overflow (the conversation is too long) or a temporary fault, and it is at least 70% sure, Empryo recovers instead of ending the turn.
jev is never asked about authentication errors. Treating a bad API key as "try again" would spend money in a loop and hide the error you need to see.
On a set of 24 real failures, the built-in pattern matching handled 23 and jev handled all 24 with no tuning, at a median of 263 ms. The one the patterns missed was a Codex error, Input exceeds the maximum length of 1048576 characters, which contains neither "context" nor "token". jev classified it as an overflow with 96% confidence.
Because triage only runs on failures the pattern matching has already given up on, a session without errors makes no TypeSafe calls at all.
What a classifier is not forLink to this section
Two other uses were built, measured against the simpler code they would have replaced, and lost.
Re-ranking grep results: over 220 real searches, the file the agent went on to read was in the top three results 78.6% of the time in the tool's own order, and 74.1% of the time in jev's order. It was removed.
The forgotten-file check: when you change some files, git history suggests five files that usually change with them, and jev was asked to pick the one this change actually needs. The top git-history suggestion was right 62.1% of the time. jev's pick was right 52.6% of the time (95 test cases from real commits). So the git-history suggestion ships on its own, with no model call.
The pattern across these results: jev is better than hand-written patterns at reading plain-language text such as error messages. It is worse than simple counting at ranking code files.
What you see and what it costsLink to this section
Each call shows a note in the chat with the decision, the model, the token count and the cost. Each call is also added to the tab's total and to your usage history.
One call costs about $0.00005. Over 290 calls, the median time was 244 ms and 90% of calls finished within 283 ms. jev costs $0.042 per million input tokens. Empryo knows this price itself, because jev is not listed in the usual model catalogs. Shadow mode still makes a paid call.
ConfigurationLink to this section
This config turns on re-ranking in shadow mode and leaves skill suggestion off:
{
"typesafe": {
"enabled": true,
"rerank": true,
"rerankMode": "shadow",
"skillSuggestion": false,
"model": "jev-latest",
"rerankTimeoutMs": 800
}
}The other switches are errorTriage and toolPick. model defaults to jev-latest. Pin a version (for example jev-1.12) if you want behavior that does not change.
Put this in ~/.empryo/config.json for all projects, or in .empryo/config.json for one project. Keep the API key in the secret field or the environment variable, not in this file.
How it failsLink to this section
- No key, or a switch is off: no call is made.
- Timeout: re-ranking has 800 ms. After that, the tool's own order is used.
- API error: the tool's own order is kept.
- Fewer than 3 results: no call is made.
- jev is unsure: if no option gets at least 15% probability, the order is left alone.
- More than 8 searches in one turn: the rest of the turn runs without re-ranking.
- The same search twice in one turn: jev is asked once and the answer is reused.
What it will not doLink to this section
Re-ranking only applies to `find`. It changes the order of results that are already there. It cannot find a file that is missing from the results. It does not write code and does not replace the model running your turn.
Re-ranking was also tried on grep and removed after it did worse on 220 replayed searches. The right file was in the top three in 78.6% of searches with the tool's order, and in 74.1% with jev's order. Re-ranking helped 21 searches and hurt 31.
A review-verdict feature was also removed, after 2 of 20 confident answers said PASS where the review said FAIL. TypeSafe does not decide whether a review passes.
See the measurements and replay method for how these results were scored.