Call TypeSafe AI's Jev from a worksheet formula.
=JEV.ASK("choice", A2, "billing", "technical", "sales", "other") → technical
=JEV.ASK("score", A2, "Calm", "Frustrated but civil", "Very angry") → 1.43
=JEV.ASK("noul", A2, "The customer is asking for a refund") → 0.93
Jev is a "System One" model. It doesn't write text. It gives you a typed, calibrated decision: which option fits, where something sits on a scale, or how likely a yes/no statement is to be true. That's the kind of answer you want in a spreadsheet cell, where you can filter, sort, pivot and chart it. Fill a formula down a column of support tickets, product reviews, survey responses or emails, and each row gets classified in milliseconds.
Unofficial. This project isn't affiliated with or endorsed by TypeSafe AI. You need your own TypeSafe API key.
- Two editions
- Quick start
- Function reference
- Worked examples
- How calls are made (batching, caching, cost)
- Installation
- Settings and security
- Proxy
- VBA edition
- Limits and tips
- Troubleshooting
- Development
- Licence
| Office add-in (recommended) | VBA edition | |
|---|---|---|
| Formula | =JEV.ASK("choice", A2, "opt1", "opt2") |
=JEV("choice", A2, "opt1", "opt2") |
| Runs on | Excel for Windows, Mac and the web (Microsoft 365) | Windows desktop Excel only |
| Calls | Asynchronous, batched and parallel. Excel stays responsive. | One at a time. Excel waits for each cell. |
| Install | Sideload a manifest or deploy centrally from the M365 admin centre | Import one .bas file and save it as an .xlam |
| Code | src/ |
vba/modJev.bas |
Office add-ins always put custom functions under a namespace, so the add-in's functions are JEV.ASK, JEV.CHOICE and so on. If you want the bare =JEV(...) spelling, use the VBA edition. Both take the same arguments and give the same outputs.
- Get an API key from TypeSafe AI (see their API docs).
- Install the add-in.
- To try it on your own PC, run
npm install,npm run certsandnpm start. Excel opens with the add-in loaded (details). - For day-to-day use or sharing, deploy it to Cloudflare and add it to Excel.
- On Excel 2016/2019, use the VBA edition.
- To try it on your own PC, run
- In Excel, open Home ▸ Jev, paste your key, and click Test connection.
- Put some text in
A2and try:=JEV.ASK("choice", A2, "complaint", "question", "praise") - Fill it down the column.
For a one-page summary, see the cheat sheet. It's src/cheatsheet.html in the repo, and the add-in's server hosts it at /cheatsheet.html, for example https://jev-excel.<your-subdomain>.workers.dev/cheatsheet.html. The task pane links to it too. It's a single self-contained file, so you can also download it, open it in any browser or print it.
=JEV.ASK(mode, text, [arg1], [arg2], ...)
| Argument | What it is |
|---|---|
mode |
"choice", "score" or "noul", optionally followed by an output selector such as "choice:probs" or "noul:bool:0.7". See Modes and outputs. |
text |
The text Jev should evaluate: a string, a cell or a range. A blank cell returns a blank result and makes no API call. A multi-cell range is sent as a list of its non-empty values. A cell that holds valid JSON (an object or array) is sent as structured data. |
arg1… |
Choice options, score rubric levels, or the yes/no question. Each one can be text or a range, and you can pass up to 253. Any argument starting with ? is used as the question. See below. |
The mode string is type[:output[:threshold]]. It isn't case-sensitive.
| Mode | Returns |
|---|---|
choice (or choice:label) |
The chosen label, e.g. billing |
choice:confidence |
Jev's confidence in that choice (0–1) |
choice:prob |
The probability of the chosen label (0–1) |
choice:probs |
A spilled 2-column table of every label and its probability, highest first |
choice:json |
The raw answer as JSON text |
Aliases for choice: classify, category, choose, pick, select.
| Mode | Returns |
|---|---|
score |
The expected level, a probability-weighted value that can fall between levels (e.g. 1.43) |
score:level |
The nearest whole level (0, 1, 2, …) |
score:label |
The rubric text for the nearest level |
score:confidence |
Jev's confidence (0–1) |
score:probs |
A spilled 2-column table of level and probability |
score:json |
The raw answer as JSON text |
Aliases for score: rate, rating, scale, rubric.
| Mode | Returns |
|---|---|
noul |
The probability that the statement is true (0–1) |
noul:bool |
TRUE if the probability is at least 0.5, otherwise FALSE |
noul:bool:0.8 |
TRUE/FALSE using your own threshold |
noul:yesno / noul:yesno:0.8 |
"Yes" / "No" |
noul:json |
The raw answer as JSON text |
Aliases for noul: yesno, yn, bool, boolean, binary.
Choice options. Each argument after text is a label. You can pass them inline or as a range.
=JEV.ASK("choice", A2, "billing", "technical", "other")
=JEV.ASK("choice", A2, $F$2:$F$9) ← labels listed in F2:F9
=JEV.ASK("choice", A2, $B$1:$E$1) ← labels across a header row
Labels become the values Jev returns, so keep them short and stable. Descriptions help Jev tell similar options apart. You can add them in two ways:
=JEV.ASK("choice", A2, "billing | Payments, invoices, refunds", "technical | Bugs or outages", "other")
=JEV.ASK("choice", A2, $F$2:$G$9) ← 2 columns and 2+ rows: label in F, description in G
Jev supports 2–255 options per question. TypeSafe recommends including an explicit other option.
Score levels. List the levels from lowest (level 0) to highest. You need 2–10.
=JEV.ASK("score", A2, "Cosmetic, no impact", "Degraded but has a workaround", "Blocking, no workaround")
=JEV.ASK("score", A2, $H$2:$H$5)
The question (? prefix). choice and score work without a question. Jev infers the task from the options. When the task isn't obvious from the options, add a question by starting any argument with ?:
=JEV.ASK("choice", A2, "?Which team should handle this ticket?", "billing", "technical", "sales")
=JEV.ASK("score", A2, "?How urgent is this request?", "Routine", "Soon", "Today", "Immediately")
Noul (yes/no). The first argument is the question or statement. You can add descriptions of what counts as TRUE and FALSE after it.
=JEV.ASK("noul", A2, "The customer is asking for a refund")
=JEV.ASK("noul", A2, "Is this urgent?", "A deadline or outage is mentioned", "No time pressure")
Statements often work as well as questions. Instructions can refer to fields in structured state using backticks (see JEV.STATE).
These do the same thing with less typing:
| Shortcut | Same as |
|---|---|
=JEV.CHOICE(text, option1, option2, …) |
=JEV.ASK("choice", text, option1, option2, …) |
=JEV.SCORE(text, level0, level1, …) |
=JEV.ASK("score", text, level0, level1, …) |
=JEV.NOUL(text, question, [when_true], [when_false]) |
=JEV.ASK("noul", text, question, when_true, when_false) |
The shortcuts return the default output for their type. For any other output, use JEV.ASK with a mode string. Identical questions share one cached answer, so =JEV.CHOICE(A2, …) and =JEV.ASK("choice:probs", A2, …) with the same options make only one API call between them.
Jev can evaluate a JSON object of named fields instead of plain text. JEV.STATE builds that object from a header row and a data row:
=JEV.STATE($A$1:$D$1, A2:D2)
→ {"Order":"A-1042","Product":"Headphones","Review":"Left earcup stopped working after a week…","Stars":2}
Pass it as the text argument, and refer to fields in your question with backticks:
=JEV.ASK("noul", JEV.STATE($A$1:$D$1, A2:D2), "`Review` describes a product defect")
The VBA edition calls this JEV_STATE.
=JEV.MODELS() spills a list of the models your key can use, with columns for name, description and release date. Set the model in the task pane. You can pin a version such as jev-1.13.0 so that probabilities and thresholds stay stable when jev-latest moves on.
| You see | Meaning |
|---|---|
#VALUE! |
Bad arguments, e.g. an unknown mode, fewer than 2 options, a missing API key or a 401/422 from the API. Hover over the cell (or select it and click the error icon) to read the message. |
#N/A |
Jev couldn't be reached, timed out, was rate-limited or overloaded after retries, or returned an unexpected response. Recalculate to try again. |
#BUSY! |
The request is still in flight. |
In the VBA edition, errors appear as text like #JEV! No Jev API key…. Run the JevToggleErrorStyle macro to switch to #VALUE!.
If you'd rather not type quotes, define three workbook names under Formulas ▸ Name Manager ▸ New: choice = ="choice", score = ="score" and noul = ="noul". Then =JEV.ASK(choice, A2, "a", "b") works. In the VBA edition, the JevAddModeNames macro adds these names for you. The VBA edition also tries to read an unquoted mode straight from the formula text, as a fallback.
Support ticket triage (ticket text in column A):
| Formula | Result | |
|---|---|---|
| Team | =JEV.CHOICE(A2, "?Which team should handle this?", "billing", "technical", "account", "other") |
billing |
| How sure | =JEV.ASK("choice:confidence", A2, "?Which team should handle this?", "billing", "technical", "account", "other") |
0.62 |
| Anger (0–2) | =JEV.SCORE(A2, "Calm, just stating facts", "Frustrated but civil", "Very angry, strong language") |
1.12 |
| Escalate? | =JEV.ASK("noul:bool:0.7", A2, "The customer threatens to cancel or complain publicly") |
FALSE |
| All probabilities | =JEV.ASK("choice:probs", A2, $F$2:$F$5) |
spills a 4×2 table |
The first two formulas ask the same question about the same text, so they share one cached answer. The anger score and the escalation check are about the same text as well, so they go out batched in the same HTTP request.
Product reviews (review text in column C):
=JEV.CHOICE(C2, "?What is the review mainly about?", $K$2:$L$8) ← topics + descriptions
=JEV.ASK("score:label", C2, "?Overall sentiment", "Very negative", "Negative", "Mixed", "Positive", "Very positive")
=JEV.NOUL(C2, "The reviewer reports a safety problem")
=JEV.NOUL(C2, "The review looks fake or incentivised", "Generic praise, no product detail, mentions a free sample", "Specific first-hand experience")
Rules on top of probabilities. The outputs are plain numbers, so ordinary Excel logic works on them:
=IF(JEV.NOUL(A2, "Mentions a legal deadline") > 0.8, "Legal", JEV.CHOICE(A2, $F$2:$F$6))
=COUNTIFS(Results!D:D, ">=0.7")
Every call becomes a POST /v1/systemone request. The request goes to the server the add-in was loaded from, which forwards it to api.typesafe.ai (see Proxy):
{
"model": "jev-latest",
"state": "I was charged twice for my subscription.",
"questions": {
"q0": { "type": "choice", "instructions": "Which team?", "criteria": { "billing": null, "technical": null, "other": null } }
}
}Several things keep this fast and cheap:
- Batching. Calls are gathered for about 40 ms. Questions about the same text (and model) go out together in one request, up to 16 at a time. Five formulas across a row of ticket text cost one round trip.
- Caching. Answers are cached in memory for the Excel session, keyed by model, text and question. Recalculating with F9, reopening the task pane, or asking for a different output from the same question doesn't call the API again. Errors are never cached. You can clear the cache from the task pane.
- Concurrency. At most 6 requests are in flight at once, which keeps large fill-downs within Jev's documented limit of 1,200 requests a minute.
- Retries. Responses with status 408, 429 or 5xx (including 529 "overloaded") and network failures are retried up to 3 times with exponential backoff. The add-in honours
Retry-Afterandretry-after-ms. - Blank in, blank out. An empty
textcell returns""without making a call. - Isolated validation errors. If one question in a batch is invalid (HTTP 422), the batch is retried one question at a time, so only the offending cell shows an error.
TypeSafe bills input tokens only; output is free at the time of writing. Check their pricing page for current rates. The task pane shows how many questions you've sent, how many input tokens they used, and your cache hits.
Freezing results. Custom functions recalculate when their inputs change, and Excel may recalculate them when a workbook opens. To lock in a set of answers, copy the column and use Paste ▸ Values.
An Office add-in has two parts:
- The add-in's files (
src/: HTML, JS, JSON and icons). They have to be served over HTTPS. While you develop, a local server on your PC serves them. For real use, a Cloudflare Worker does. - A manifest (
manifest.xml). This small XML file tells Excel the add-in's name and where its files are. You add the add-in to Excel by giving Excel a manifest.
Either way, the server also forwards Jev calls to TypeSafe, because TypeSafe doesn't accept calls straight from an add-in (see Proxy). Every user pastes their own TypeSafe key into the add-in.
Pick a route:
| You want to… | Do this |
|---|---|
| Try it or work on it on your own PC | 1. Run it locally. On desktop Excel, npm start also adds it to Excel for you. |
| Use it day to day, or share it | 2. Deploy to Cloudflare, then 3. Add it to Excel |
Use Excel 2016/2019, or the bare =JEV(...) syntax |
The VBA edition. No Node, server or manifest needed. |
Requirements: Excel with the SharedRuntime 1.1 requirement set. That means Microsoft 365 on Windows or Mac, or Excel on the web. Perpetual Excel 2016/2019 isn't supported, so use the VBA edition there. To run or deploy the add-in you also need Node.js 20 or later.
The local version runs from a dev server on your PC at https://localhost:3000. That server serves the add-in's files and forwards Jev calls to TypeSafe. Excel loads the add-in from it using the repo's own manifest.xml, which points at localhost. Only the PC running the server can use this version.
One-off setup, in the repo folder:
npm installnpm run certsnpm run certs creates an HTTPS certificate for localhost and asks Windows or macOS to trust it. Click Yes when the security prompt asks whether to install the certificate. Office only loads add-ins over HTTPS.
npm startThis does three things:
- It opens a second terminal window running the dev server. Leave that window open. If it closes, the add-in stops working and cells show errors.
- It registers
manifest.xmlwith desktop Excel as a developer add-in. On a Mac, it copies the manifest into Excel'sweffolder. - It opens Excel with a new workbook that has the add-in loaded.
Then:
- In Excel, look at the right-hand end of the Home tab for a Jev group with a Jev button. Click it to open the settings pane.
- Paste your TypeSafe API key, click Save, then click Test connection.
- In a cell, type
=JEV.. Excel's autocomplete should listJEV.ASK,JEV.CHOICEand the rest.
Next time: the add-in stays registered and loads in every new Excel window. Only the server needs restarting. Run this and leave it running before you open Excel:
npm run serveIf you opened Excel without the server running, close Excel, start the server, then reopen Excel.
When you're finished: this unregisters the add-in and stops the server:
npm run stopnpm run start:web starts the server and opens a workbook with the add-in loaded. It needs the address of a workbook in OneDrive or SharePoint. Open one in your browser, copy the address from the address bar, and pass it in:
npm run start:web -- --document "https://onedrive.live.com/edit.aspx?resid=..."Alternatively, start the server yourself and add the repo's manifest.xml by hand, as described in 3. Add it to Excel:
npm run serveExcel on the web loads the files from localhost in your browser, so this only works on the PC running the server.
npm start covers most cases. If you'd rather add the add-in yourself, for example on a PC where npm start can't open Excel:
- Run
npm run serveand leave it running. - Open
https://localhost:3000/taskpane.htmlin a browser. You should see the settings page with no certificate warning. The page does nothing outside Excel, but if it loads, the server and certificate are working. - Follow 3. Add it to Excel using the repo's
manifest.xml.
For real use, deploy the add-in to Cloudflare Workers. The free plan is enough. One Worker, named jev-excel, does everything from one URL:
- It serves the add-in's files.
- It forwards Jev calls to TypeSafe.
- It serves a
manifest.xmlthat points at its own URL, and afunctions.jsonwhose Help on this function links open the right section of its cheat sheet.
It holds no keys and needs no secrets or settings. The code is worker/index.mjs, and it's configured in wrangler.toml.
- Create a Cloudflare account at dash.cloudflare.com if you don't have one.
- Log in from the repo folder. This opens a browser so you can authorise Wrangler, Cloudflare's command-line tool. You only need to do it once per PC.
npx wrangler@4 login
- Deploy. This builds
dist/fromsrc/and uploads it together with the Worker:The first time, Wrangler may ask you to choose anpm run deploy
workers.devsubdomain for your account. - Note the URL Wrangler prints, for example
https://jev-excel.<your-subdomain>.workers.dev. - Check it. Open
https://jev-excel.<your-subdomain>.workers.dev/taskpane.htmlin a browser. You should see the settings page. The manifest you'll give Excel is athttps://jev-excel.<your-subdomain>.workers.dev/manifest.xml.
The manifest is generated for whatever address it's requested from, so it keeps working if you later add a custom domain to the Worker.
Try the Worker locally first (optional). This runs the same Worker code on your PC, at http://localhost:8787:
npm run buildnpx wrangler@4 devIt's plain HTTP, so Excel won't load the add-in from it, but you can check the routes in a browser or with curl. To work on the add-in itself, use 1. Run it locally.
To update the deployed add-in, run npm run deploy again.
This works the same for both versions. Only the manifest differs:
| Version | Manifest | Must be running |
|---|---|---|
| Local | manifest.xml in the repo, which points at https://localhost:3000 |
npm run serve on the same PC |
| Deployed | https://jev-excel.<your-subdomain>.workers.dev/manifest.xml. Open it in a browser, press Ctrl+S (⌘S on a Mac) and save it as manifest.xml. |
Nothing. The Worker is always on. |
Don't add both versions at once. They share the same add-in ID, so Excel treats them as the same add-in. Remove one before adding the other.
- Open any workbook in Excel on the web.
- Go to Home ▸ Add-ins ▸ More Add-ins. In some versions the path is Insert ▸ Add-ins ▸ More Add-ins.
- Open the My Add-ins tab and click Upload My Add-in at the top right.
- Click Browse…, choose your
manifest.xmland click Upload.
The Jev button appears on the Home tab. The upload is stored in your browser, so you may need to repeat it on another browser or after clearing browser data.
Desktop Excel for Windows won't open a manifest file directly. It reads manifests from a shared folder that you mark as trusted. The folder can be on your own PC.
- Create the folder. Make a folder, for example
C:\JevManifest, and put yourmanifest.xmlin it. - Share it. Right-click the folder and choose Properties ▸ Sharing ▸ Share…. Click Share, then Done. Note the network path it shows, for example
\\YOUR-PC\JevManifest. Excel needs this\\…path. AC:\…path won't work. - Trust it in Excel. Go to File ▸ Options ▸ Trust Center ▸ Trust Center Settings… ▸ Trusted Add-in Catalogs.
- Paste the
\\YOUR-PC\JevManifestpath into Catalog Url and click Add catalog. - Tick Show in Menu for that row.
- Click OK twice.
- Paste the
- Restart Excel. Close every Excel window and reopen it.
- Add it. Go to Home ▸ Add-ins ▸ More Add-ins, or Insert ▸ Get Add-ins ▸ My Add-ins on older builds. Open the SHARED FOLDER tab, select Jev for Excel and click Add.
The Jev button appears on the Home tab, and Excel remembers the add-in from then on. To share the deployed version with colleagues, put its manifest on a network share everyone can read, and have each person do steps 3–5.
- In Finder, choose Go ▸ Go to Folder… and enter
~/Library/Containers/com.microsoft.Excel/Data/Documents/wef. If the folder doesn't exist, create theweffolder insideDocuments. - Copy your
manifest.xmlinto it. - Quit Excel completely (⌘Q) and reopen it.
- Go to Home ▸ Add-ins, or Insert ▸ My Add-ins. Choose Jev for Excel from the list under Developer Add-ins.
- In the Microsoft 365 admin centre, go to Settings ▸ Integrated apps ▸ Upload custom apps.
- Choose Office Add-in, then give the Worker's manifest URL or upload the saved
manifest.xml. - Assign it to users or groups.
The add-in then appears on those users' Home tab without any further steps. It can take several hours to reach everyone.
- Open Home ▸ Jev.
- Paste your own TypeSafe API key and click Save. Leave Base URL blank, so the add-in uses the server it was loaded from.
- Click Test connection.
- The Home tab has a Jev button, and clicking it opens the settings pane.
- Typing
=JEV.in a cell brings up the function list. If Excel shows#NAME?instead, the add-in isn't loaded in that window. - After you save your key, Test connection reports success.
- Updating the local version. Changes to
src/take effect the next time the task pane or Excel reloads. The dev server doesn't cache. - Updating the deployed version. Run
npm run deploy. People pick up the new version the next time they start Excel. - If Excel keeps showing an old version, close Excel, clear the Office add-in cache, and reopen Excel. The cache is in
%LOCALAPPDATA%\Microsoft\Office\16.0\Wef\on Windows and~/Library/Containers/com.microsoft.Excel/Data/Library/Caches/on a Mac. - Removing it.
- Added with
npm start: runnpm run stop. - Added by hand: go to Home ▸ Add-ins ▸ More Add-ins ▸ My Add-ins, click the … menu on Jev for Excel and choose Remove. On a Mac, also delete the manifest from the
weffolder.
- Added with
- Taking the deployed version down. Delete the
jev-excelWorker in the Cloudflare dashboard, or runnpx wrangler@4 delete.
The Jev task pane (Home ▸ Jev) has these settings:
| Setting | Default | Notes |
|---|---|---|
| API key | none | Your own TypeSafe key. It's always needed. |
| Model | jev-latest |
Pin a version, e.g. jev-1.13.0, if thresholds matter. |
| Base URL | The server the add-in was loaded from | Leave it blank. The dev server and the Cloudflare Worker both forward calls to TypeSafe (see Proxy). Set it only to use a different proxy. |
| Cache answers | on | Turn off to force every recalculation to call Jev. |
The page also has Test connection, Recalculate all, Clear cache and live usage statistics.
Where the key is stored: in the add-in's own browser storage (localStorage for the add-in's origin) on that device, for that user. It never goes into the workbook, so you can share workbooks safely, but it isn't encrypted at rest. Anyone who uses your Windows or Mac profile can read it.
What's sent: only the text argument (or the JEV.STATE fields) and your question go to the API. Don't point Jev at data that your organisation's policies don't allow you to send to a third-party API.
Why there's a proxy. api.typesafe.ai rejects requests from browsers: its CORS check answers Disallowed CORS origin for any origin. Office add-ins run inside a browser engine, so they can't call it directly. Instead, the add-in calls /v1/systemone and /v1/models on the server it was loaded from, and that server forwards the calls to TypeSafe:
- Locally, that's the dev server behind
npm startandnpm run serve. - Deployed, it's the Cloudflare Worker (see Deploy to Cloudflare).
The add-in and its proxy share an origin, so there's no CORS to configure. The VBA edition isn't a browser, so it calls TypeSafe directly.
The proxy never holds a key. Each request carries the user's own TypeSafe key, which the proxy passes through unchanged. Usage is billed to that user's TypeSafe account, and the Worker's code doesn't log or store anything. That makes it safe to host one copy for anyone to use. Anyone who'd rather not send their key through your Worker can deploy their own copy from this repo.
To check a deployed Worker, replace the URL and key with your own:
curl -H "Authorization: Bearer YOUR_TYPESAFE_KEY" https://jev-excel.YOUR-SUBDOMAIN.workers.dev/v1/modelsFor Windows desktop Excel, with the literal =JEV(...) syntax:
=JEV("choice", A2, "option1", "option2")
=JEV("score:label", A2, "Low", "Medium", "High")
=JEV("noul:bool", A2, "Mentions a deadline")
=JEV_STATE($A$1:$C$1, A2:C2)
=JEV_MODELS()
Install:
You need Windows desktop Excel 2010 or later (32- or 64-bit). You don't need Node, a web host or a manifest. You build a Jev.xlam add-in file once, then switch it on in Excel.
-
Get the code. You need
vba/modJev.bas, plusvba/ThisWorkbook.cls.txtif you want function help text (step 4). If you don't have a clone, open each file on GitHub and click Download raw file. -
Open the VBA editor. In Excel, create a new blank workbook and press Alt+F11.
-
Import the module. In the VBA editor, choose File ▸ Import File… and pick
modJev.bas. In the Project pane on the left, Modules ▸ modJev should now appear under VBAProject (Book1). If the pane is hidden, press Ctrl+R. -
(Optional.) Add help text for the Insert Function dialog. In the same project, open Microsoft Excel Objects and double-click ThisWorkbook. Paste the whole of
ThisWorkbook.cls.txtinto the code window that opens. -
Check it compiles. Choose Debug ▸ Compile VBAProject. If nothing happens, it compiled without errors.
-
Save it as an add-in.
- Close the VBA editor and go back to Excel.
- Choose File ▸ Save As ▸ Browse and set Save as type to Excel Add-in (*.xlam). Excel switches to your add-ins folder (
%APPDATA%\Microsoft\AddIns). Keep that location. - Name the file
Jevand click Save. - Close the workbook. You don't need to save
Book1.
-
Switch it on.
- Go to File ▸ Options ▸ Add-ins.
- At the bottom, set Manage to Excel Add-ins and click Go….
- Tick Jev and click OK. If Jev isn't listed, click Browse… and pick
Jev.xlam.
Excel loads the add-in every time it starts from now on.
-
Set your API key.
- Press Alt+F8.
- Type
JevSetApiKeyin the Macro name box and click Run. The macro isn't in the list because add-in macros are hidden, but typing its name works. - Paste your key when prompted.
The key is stored in your Windows user registry. Instead of using the macro, you can set a
TYPESAFE_API_KEYuser environment variable and restart Excel. -
Try it. In any workbook, enter:
=JEV("noul", "I'd like my money back please", "The customer wants a refund")You should get a probability close to 1.
=JEV_MODELS()is another quick connectivity check.
Sharing it with colleagues. Give them your Jev.xlam. Each person copies it into %APPDATA%\Microsoft\AddIns and follows steps 7–9. If the file came by email or download, Windows marks it as coming from the internet, and Excel blocks its macros. To prevent that, right-click the file, choose Properties, tick Unblock and click OK, all before loading it.
Updating.
- Press Alt+F11.
- In the Project pane, find VBAProject (Jev.xlam), right-click modJev and choose Remove modJev. Answer No to exporting it.
- Import the new
modJev.basinto the same project. - With that project selected, press Ctrl+S.
Removing. Untick Jev in File ▸ Options ▸ Add-ins ▸ Excel Add-ins ▸ Go…, then delete Jev.xlam.
Macros: JevSetApiKey, JevSetModel, JevSetBaseUrl, JevClearCache, JevShowStats, JevAddModeNames, JevToggleErrorStyle, JevRegisterFunctions.
Differences from the add-in:
- Calls run one at a time and Excel waits for each. Jev usually answers in well under a second, but a fill-down over thousands of rows takes a while, so set calculation to Manual (Formulas ▸ Calculation Options) for large sheets.
- There's no batching. The session cache does apply, and it's cleared when Excel closes.
- Settings are stored in
HKCU\Software\VB and VBA Program Settings\JevForExcel. - HTTP goes through
MSXML2.XMLHTTP.6.0, which respects the Windows system proxy. ChangeHTTP_CLASSat the top of the module if your network needsWinHttp. - Errors appear as
#JEV! messagetext by default, so you can see what went wrong. - After an invalid key (401/403), or when Jev can't be reached after retries, the remaining cells fail immediately with the same message for 30 seconds instead of each one retrying. Changing the key or base URL, or running
JevClearCache, clears this. - The base URL must use
https://.http://is accepted only forlocalhost, so the key never travels unencrypted.
Mac VBA can't use these Windows HTTP components. On a Mac, use the Office add-in.
These are Jev's documented limits (check TypeSafe's docs for the latest):
| Limit | Value |
|---|---|
| Choice options | 2–255 |
| Score rubric levels | 2–10 |
| State plus the longest question | about 32k tokens (roughly 150k characters) |
| Total per request | about 64k tokens |
| Rate limit | 1,200 requests a minute, 250k tokens a second |
| Input | text or JSON only |
Tips:
- Word questions as statements. "The customer is asking for a refund" often works better than "Refund?".
- Keep each question to one thing. Jev is weak at multi-part questions, arithmetic and indirect reasoning. Split a compound question into several columns and combine them with
AND/IF. - Give options descriptions when they overlap, and include an
otheroption. - Use probabilities, not just labels.
choice:probsandnoullet you set your own cut-offs and send low-confidence rows to a human. - Pin the model (e.g.
jev-1.13.0) before you tune thresholds, so that a newjev-latestdoesn't move your cut-offs. - Mind cell limits. An Excel cell holds at most 32,767 characters. For longer documents, split the text across a range, which is sent as a list.
| Symptom | Fix |
|---|---|
#NAME? for JEV.ASK |
The add-in isn't loaded in this Excel session. Open Home ▸ Jev (or reinstall) and recalculate. |
| Jev pane is blank, or Excel says the add-in couldn't start (local install) | The dev server isn't running. Run npm run serve, leave it running, and restart Excel. |
| No Jev for Excel under SHARED FOLDER (Windows) | The catalog must be a \\server\share network path with Show in Menu ticked, and Excel must be restarted after you add it. |
#VALUE! "No Jev API key set" |
Add your key in Home ▸ Jev and click Save. Saving recalculates the workbook. |
#VALUE! "Invalid or missing API key (HTTP 401)" |
Check your TypeSafe key in Home ▸ Jev. |
#N/A "Could not reach the Jev API (network or CORS error)" |
Base URL in Home ▸ Jev points at api.typesafe.ai, which browsers can't call. Clear it, click Save and try again. |
#N/A "Could not reach https://… (network or CORS error)" |
The server the add-in calls isn't answering. Locally, start it with npm run serve. When deployed, check the Worker with the curl command under Proxy. |
#N/A "Rate limited" or "overloaded" |
Jev was busy even after retries. Recalculate the affected cells a moment later. |
| Results didn't change after editing options | They should. Options are part of the cache key. If you changed the model or API key, click Clear cache. |
#BUSY! for a long time |
A very large fill-down is queued. Up to 6 requests run at once, and the task pane shows progress. |
VBA: #JEV! Could not reach https://… |
Check your network's proxy settings, or switch HTTP_CLASS to "WinHttp.WinHttpRequest.5.1". |
jev-excel/
├── manifest.xml Add-in manifest (localhost URLs; the Worker serves it rewritten to its own URL)
├── wrangler.toml Cloudflare Worker configuration
├── worker/index.mjs Cloudflare Worker: serves dist/, proxies /v1/* to TypeSafe, rewrites manifest.xml and functions.json to its own URL
├── src/ The add-in itself (built into dist/ by `npm run build` for the Worker)
│ ├── jev-core.js Core logic: parsing, request building, batching, cache, retries (UMD, testable in Node)
│ ├── functions.js Custom function bindings (JEV.ASK, CHOICE, SCORE, NOUL, STATE, MODELS)
│ ├── functions.json Custom function metadata (names, parameters, help text)
│ ├── taskpane.html/.css/.js Settings pane; shares a runtime with the functions
│ ├── cheatsheet.html One-page formula guide (self-contained; served at /cheatsheet.html)
│ └── assets/ icon.svg, and the icon PNGs rendered from it by `npm run icons`
├── vba/
│ ├── modJev.bas VBA edition (=JEV, =JEV_STATE, =JEV_MODELS and macros)
│ └── ThisWorkbook.cls.txt Optional Workbook_Open hook for function help text
├── scripts/
│ ├── serve.js HTTPS dev server on :3000, with the same /v1/* proxy as the Worker
│ ├── build.js Builds dist/ for the Worker
│ └── icons.js Renders src/assets/icon.svg to every PNG size
├── test/
│ ├── jev-core.test.js Core logic against a mock Jev API
│ ├── proxies.test.js Dev server and Worker: static files, proxying, URL rewriting
│ └── project.test.js Version numbers agree; functions.json matches functions.js; help links land on the cheat sheet
└── .github/workflows/ci.yml Runs the tests on Node 20 and 22
npm test # all tests (Node 20+). No dependencies, network or API key needed.
npm run serve # HTTPS dev server on :3000
npm run deploy # build dist/ and deploy the Worker to Cloudflare
npm run icons # re-render the icon PNGs after editing src/assets/icon.svg
npm run validate # Microsoft's manifest validator (needs internet)The add-in uses a shared runtime: taskpane.html loads jev-core.js, functions.js and taskpane.js into a single JavaScript context. That's why the settings pane and the formulas share one client, one cache and one set of statistics. functions.json is written by hand, so if you add a function, register it in both functions.js (CustomFunctions.associate) and functions.json. Give it a helpUrl pointing at a matching section of cheatsheet.html, which Marketplace review requires. npm test fails if any of these are missing or disagree. The same goes for the version number, which lives in package.json, jev-core.js, manifest.xml and modJev.bas.
API reference used: POST /v1/systemone with { model, state, questions }. The question types are noul (optional criteria.true/criteria.false), choice (criteria maps each label to a description or null) and score (criteria is an array of 2–10 levels). Answers come back keyed by question id. GET /v1/models returns { models: [{ name, description, release_date }] }. See the TypeSafe API reference and the official @typesafe-ai/sdk.
MIT © 2026 Paul O'Brien. See also the privacy policy, the end-user licence agreement and support. "Jev" and "TypeSafe" are names of TypeSafe AI and are used here only to describe compatibility.