Reference · Smith
The Smith, for developers
What the Smith shows with developer staff hired, the model servers it keeps and the rules it keeps them by, and what's under Models and Audits (new servers and models for your NPU, the checks every switch must pass), with its files, commands and local API.
- Article
- 1403
- Applies to
- Smith 0.9.4
- Last reviewed
- For
- For developers
What changes with developer staff hired#
With one of Castellan's developer staff hired, the Smith's page names things as they are: The model servers rather than The local AI, with their addresses and programs. It also has two more parts: Orphans, on the first tab, and editing the accelerators by hand, with Plan, in its About under Set up the accelerators. Its settings and the tour use the same words.
The Models and Audits tabs are on everyone's page (see The Smith). Below is what's under them, in a developer's words.
The model servers#
| Accelerator | Model server |
|---|---|
| A Snapdragon's NPU | GenieX |
| An Intel Core Ultra's NPU | OpenVINO Model Server |
| An AMD Ryzen AI 300's NPU | FastFlowLM |
| A graphics card, or the processor | llama.cpp's server |
Each server serves what Set up checked: chat, vision, embeddings, and a reranker (through llama.cpp's --reranking) that Reeve's search uses from Reeve 0.15.0.
The rules it keeps them by#
Every minute (its round, paused while it's off duty), the Smith looks at every model server the manor runs:
| When | It |
|---|---|
| Nobody has held or waited on an accelerator for its idle time (10 minutes each, in Settings) | stops its servers. The next request from any of the staff starts them again. |
| A game is using a graphics card, and nobody has used the card for 2 minutes | stops the card's servers. |
| Castellan's Use the graphics card for models when there's an NPU is off | stops a card's servers as soon as nobody uses the card, and doesn't restart them. |
| A server hasn't answered for 3 minutes while nobody uses its accelerator | restarts it. A probe that times out means busy: GenieX answers nothing while it loads or answers. |
| GenieX holds 9 GB of working set while nobody uses the NPU | restarts it (it keeps about 340 MB for every model it loads, until it exits). |
| A model server on the manor's ports that no configured server is (an orphan) | stops it after 5 minutes, and logs its path and command line. Only one that's the manor's own: its program in the manor's servers folders, or one the manor started. Never by its port alone. |
Each stop or restart takes the accelerator's turn as background work that joins only an empty line, so it never takes anyone's turn. What it did is under What it did, beside the servers on its page, and in servers\logs\reaper.log in the accelerators folder.
Models: New for your NPU#
The tab is Models on every PC. On one with an NPU, every 6 hours the Smith looks for newer model servers and models for your NPU that the manor supports, and lists them under New for your NPU, servers and models apart, each with Try it and Not now. It offers only models built for your chip, none you already run, and none whose license must first be accepted on Hugging Face; the NPU card names the model your NPU runs now. Look now looks at once; Stop looking stops the looks.
Try it installs the new one beside what works, times both on the same questions, and then runs the audit's checks on the new one, on its own port (see Every switch is checked first):
- Faster or as fast, and it answers right: it's used at once, and the Smith says how they compare ("the new server answers 18% faster than the one you had"). To go back, choose the one before under NPU setup in Settings (below).
- Slower: what you had stays in use, and both are shown side by side, with Use it anyway or Keep what I have. A newer server that installs over the old one is taken out again at once, so the old one keeps running.
- It fails: what you had stays in use, exactly as it was, and the try's lines say why in the server's own words; a crash is summed up from its report. Try again is on the failed try's own card.
- It answers worse: a check that what you had passes fails, or the checks can't finish. The try fails as above, and its lines name the failed checks.
A model is tried on the server version you have installed, as that version runs it. The models' audit never runs beside a try, and a server or model you already use doesn't stop you trying the next one.
How your NPU has performed lists every setup your NPU has run on this PC: how long it takes to write a short paragraph, tokens a second, how long the first answer takes (loading the model), and how long a question about a picture takes. Time it now times today's setup: after a driver update, say.
The NPU setup setting (under Advanced): The one I had before the last try goes back to it, and asks you before any switch from then on.
Audits: do the models still answer right?#
A driver or model update can leave a model answering, but wrong. The Smith checks for that, in two parts:
- The fingerprint, every hour, with no model: each accelerator's driver, model server and version, and models. A change is logged, and makes the accelerator's audit due.
- An audit asks each accelerator a few small questions whose answers code checks exactly, and compares the results with its last good audit on that toolchain (its baseline):
| Check | What it asks |
|---|---|
| Chat | Golden questions with one exact answer each: a number, a name, yes or no, a line number, a date, a letter. |
| Determinism | One question asked twice, expecting the same words; and on GenieX, whether one answer leaks into the next. |
| Vision | A few words drawn on a picture, and what the vision model reads. |
| Embeddings | One sentence embedded on the NPU, compared with a reference made on the processor. |
| Latency | Median time to an answer and tokens a second, against the baseline. |
With Audit by itself on (the default), an audit runs the first time an accelerator is checked, and after every change to its driver, server or model, as soon as the accelerator is free. While nothing changes, none runs: its models answer as they did. Off, audits run only from Audit now, and a change asks you to run one. A Set up, or a try put in use, audits every accelerator right after it.
Every switch is checked first
Since Smith 0.8.71 the checks are the last step of every switch to a new model or server. They run on the new setup and are judged against the baseline of the setup in use, and nothing is recorded: no audit line, no baseline.
| Its checks | The setup in use's last audit | Then |
|---|---|---|
| pass, or pass with a warning | any | It may be used. |
| fail | passed, or none yet | It isn't used. |
| fail | failed too | It may be used: it isn't worse. |
| couldn't finish | any | It isn't used. |
- A try (Models) that isn't used fails, and everything it added is taken out again.
- Set up checks each accelerator whose chat or vision model, server or command it changed. One that isn't used gets its previous
config.jsonentry back, when every file that entry runs from is unchanged (the same size and time). If Set up replaced them (a newer server installed over the old one), the new setup stays, and its lines and Audits say what failed. If the checks couldn't finish, Set up's work stays, and the next round checks it.
The Audits tab shows the verdict, Audit now and Read the fingerprints now, and each accelerator's audit in a card of its own, tagged NPU or graphics card, with when it was audited and when it was last checked for changes. Its checks and the replies beside the expected answers are on the left, its fingerprint and history on the right; with several accelerators, pick one from the list. A reply is labelled "reply from the Smith". A graphics card resting beside the NPU serves nothing, so it isn't audited. Each accelerator's badge says how it stands: checked: answers right, a check is due, answered wrong: see Audits.
The checks' own settings are in Settings, on the Audits tab beside General: Audit by itself and Read the fingerprint every, and, shown only with developer features on, which checks run, the lowest embedding cosine, and how much slower than the baseline warns.
Editing the accelerators#
In the Smith's About, under Set up the accelerators, Accelerators shows the list all the staff read, as JSON: each accelerator's id, slots, request cap, memory, quirks, and its chat, vision, embedding and reranking servers (address, model, and the command that starts it). Order is auto (the NPU first, then graphics cards with 2 GB or more of their own memory, then graphics that share the PC's memory, then the processor), or ids, first preferred. Save the accelerators checks it first, and refuses it if the file changed since the page read it. Plan (downloads nothing), beside Set up, says what a setup would do.
Files#
| Where | What |
|---|---|
%USERPROFILE%\.manor\accelerators\config.json | The accelerators, their order, and the idle times: all the staff read it. The Smith writes only its own keys and keeps the rest. |
%USERPROFILE%\.manor\accelerators\servers, models | The servers Set up unpacked, and the models. On a PC set up before Castellan moved them, %USERPROFILE%\.reeve\servers and models. |
%USERPROFILE%\.smith | The Smith's own data; audits\ holds the checks' settings, audits, baselines and fingerprints. |
SMITH_HOME moves its data folder, and SMITH_PORT its page.
Commands#
Run with node $HOME\.smith\app\src\cli.ts <command>:
| Command | What it does |
|---|---|
run | One look now. |
accelerators | This PC, config.json, and the recommended order. --json for scripts. |
accelerators setup [<id> ...] | Sets up the accelerators named (all by default). --serve chat,vision,embed,rerank chooses what each serves; --dry-run plans only; --yes skips the question. |
fingerprints | Reads the fingerprints once, and runs the audits due after a change (or an accelerator's first). |
audit | Audits every accelerator now. |
start, stop, open, shutdown, status [--json] | Duty and its page, as every employee has them. |
uninstall [--purge] [--dry-run] | Removes it; --purge removes its data too. |
Local API#
The page answers at http://smith.localhost:20202/:
| Address | What it answers |
|---|---|
GET /api/ping | Its version and duty, with the worst audit verdict and whether an audit is due (auditDue). |
GET /api/accelerators | Its last look, as JSON. |
GET /api/checked | Whether each accelerator's models still answer right: {app, state, busy, accelerators: [{id, kind, name, toolchain, state, reason, last}]}. |
GET /api/report | Everything the Audits part of the page is made from. |
Related articles
Is this page right?
If something on it is wrong or out of date, tell us and we'll fix the page.
Still stuck? Write to support@castellan-software.com and mention article 1403. Every version of Smith, and what changed in it, is in its release notes.