Skip to content
Castellan
Smith's icon

Reference · Smith

Read as

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
Written for Smith 0.9.4; Smith 0.10.1 is out now. Some of this may have changed: what's new is in its release notes.

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#

AcceleratorModel server
A Snapdragon's NPUGenieX
An Intel Core Ultra's NPUOpenVINO Model Server
An AMD Ryzen AI 300's NPUFastFlowLM
A graphics card, or the processorllama.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:

WhenIt
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 minutesstops the card's servers.
Castellan's Use the graphics card for models when there's an NPU is offstops 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 acceleratorrestarts 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 NPUrestarts 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):
CheckWhat it asks
ChatGolden questions with one exact answer each: a number, a name, yes or no, a line number, a date, a letter.
DeterminismOne question asked twice, expecting the same words; and on GenieX, whether one answer leaks into the next.
VisionA few words drawn on a picture, and what the vision model reads.
EmbeddingsOne sentence embedded on the NPU, compared with a reference made on the processor.
LatencyMedian 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 checksThe setup in use's last auditThen
pass, or pass with a warninganyIt may be used.
failpassed, or none yetIt isn't used.
failfailed tooIt may be used: it isn't worse.
couldn't finishanyIt 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.json entry 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#

WhereWhat
%USERPROFILE%\.manor\accelerators\config.jsonThe 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, modelsThe servers Set up unpacked, and the models. On a PC set up before Castellan moved them, %USERPROFILE%\.reeve\servers and models.
%USERPROFILE%\.smithThe 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>:

CommandWhat it does
runOne look now.
acceleratorsThis 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.
fingerprintsReads the fingerprints once, and runs the audits due after a change (or an accelerator's first).
auditAudits 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/:

AddressWhat it answers
GET /api/pingIts version and duty, with the worst audit verdict and whether an audit is due (auditDue).
GET /api/acceleratorsIts last look, as JSON.
GET /api/checkedWhether each accelerator's models still answer right: {app, state, busy, accelerators: [{id, kind, name, toolchain, state, reason, last}]}.
GET /api/reportEverything the Audits part of the page is made from.

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.