prism-mcp-server 20.21.27 → 20.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -59,6 +59,68 @@ A paid subscription adds cloud sync, higher model tiers, and team features throu
59
59
  never sent to the cloud), and local/cloud usage is recorded for
60
60
  review.
61
61
 
62
+ ### Explicit on-device oMLX drafts
63
+
64
+ `prism_infer` keeps Ollama's four-tier routing by default. For an explicitly
65
+ selected text-only code or advisory reviewer draft, pass `local_backend: "omlx"`,
66
+ `mode: "code"`, and optionally `local_model` with the exact advertised model ID.
67
+ This path authenticates `/v1/models` before classification or any Ollama unload;
68
+ an unavailable, unauthenticated, or mismatched model refuses without substitution.
69
+ It reads `OMLX_API_KEY` or the local `~/.omlx/settings.json` key, and model/context
70
+ settings from `~/.omlx/model_settings.json`; `OMLX_MODEL` and a loopback-only
71
+ `OMLX_BASE_URL` can select local configuration. Redirects are refused.
72
+
73
+ **Requires** an oMLX build with Prism's control routes: the
74
+ [`prism-v0.7.1rc1` branch of dcostenco/omlx](https://github.com/dcostenco/omlx/tree/prism-v0.7.1rc1), upstream oMLX
75
+ 0.7.1rc1 plus those routes ([install and settings](https://github.com/dcostenco/omlx/blob/prism-v0.7.1rc1/PRISM.md)). With stock
76
+ oMLX every call is refused. Generation runs as an owned
77
+ job through those routes, so a timeout or cancel is reported only once the
78
+ server confirms the request stopped. An unconfirmed stop refuses later calls
79
+ (`omlx_stop_unproved`, `omlx_provider_busy`).
80
+
81
+ Before classification, Prism unloads every model Ollama has loaded
82
+ (`keep_alive: 0`; the weights stay on disk and reload on the next Ollama call)
83
+ and waits up to 10 seconds for Ollama to report none. A failed unload, a model
84
+ that does not drain, or one loading meanwhile refuses the call; a newcomer is
85
+ never unloaded. Ollama must be reachable for this step. An OS-owned loopback
86
+ lease on port 19438 excludes other candidate MCP processes; ordinary calls within
87
+ one process share this lease. A busy lease refuses (`omlx_resource_busy`) before
88
+ classification or unloading, and process exit releases it without lock-file
89
+ cleanup. In-process inference and classification wait while an oMLX call owns
90
+ the device. Unknown Ollama state, newly loaded Ollama weights, or available
91
+ memory below a 2 GiB reserve aborts/withholds the generation. Model caches and
92
+ daemons remain in place. Legacy/unmodified MCP processes do not honor the lease;
93
+ their contention is observed and rejected by the watcher.
94
+
95
+ **Safety screen.** The classifier on this path is the public
96
+ `dcostenco/prism-coder-9b-mlx-8bit`, installed under the name
97
+ `prism-coder-9b-mlx-8bit` in oMLX's model folder (about 9.2 GB while loaded).
98
+ Layer 1's rules only refuse here; the classifier reads everything else, and a
99
+ prompt over 4,000 characters is read whole in 3,600-character windows (the most
100
+ severe verdict stands), never as an excerpt. A classifier failure, an unreadable
101
+ answer, or a missing classifier refuses the call; there is no keyword or Ollama
102
+ fallback. A classifier read may take up to 90 seconds, so a classifier that
103
+ macOS paged out during a long idle is waited for rather than refused.
104
+
105
+ Configured oMLX sampling and reasoning are preserved unless `temperature` or
106
+ `think` is explicit, including through repairs. Generic thinking-disable retries
107
+ are disabled for oMLX, so a model with no thinking budget in oMLX's model
108
+ settings can spend its whole answer reasoning and is refused `think_only`: give
109
+ it a budget there, or pass `think: false`. The default 300-second budget bounds
110
+ oMLX generation, repairs, and history answer checks; `timeout_ms` may override it
111
+ up to 900 seconds. Context sizing uses conservative UTF-8 bytes and the
112
+ configured window.
113
+
114
+ The same entitlement, reserved-content, history, quality, output-safety, and
115
+ verification policies apply. Explicit oMLX never falls back to Ollama/cloud
116
+ inference. `cloud_fallback: false`, `verify: false`, and `route_guard: "local"`
117
+ keep content-bearing cloud channels disabled for a local draft. Result metadata
118
+ reports `backend: "omlx"`, the selected model, tokens, and `gate_outcome`.
119
+ The MCP envelope carries this public metadata in `structuredContent` alongside
120
+ the existing human header/output text; `next_step` remains available in both.
121
+ Runtime authentication and internal verifier traces are excluded.
122
+ A draft is advisory and requires independent host review; it is not final sign-off.
123
+
62
124
  ## Get started
63
125
 
64
126
  Memory search automatically applies ACT-R ranking: relevance plus recency,
@@ -170,6 +232,44 @@ or by re-enabling after each run.
170
232
  <details>
171
233
  <summary>Release history (optional)</summary>
172
234
 
235
+ ## What's New in v20.22.0
236
+
237
+ **Why it matters:** on Apple Silicon, `prism_infer` can now draft code on an
238
+ oMLX server instead of Ollama, opt-in per call, behind its own safety screen.
239
+ Separately, Layer 1 now marks two more kinds of auth request reserved, on every
240
+ path.
241
+
242
+ - **Opt-in oMLX backend:** `local_backend: "omlx"` with `mode: "code"`, text
243
+ only. Nothing changes for calls that do not ask for it. It **requires** the
244
+ oMLX build with Prism's control routes, published as the
245
+ [`prism-v0.7.1rc1` branch of dcostenco/omlx](https://github.com/dcostenco/omlx/tree/prism-v0.7.1rc1)
246
+ ([install and settings](https://github.com/dcostenco/omlx/blob/prism-v0.7.1rc1/PRISM.md)); with stock oMLX every call is refused.
247
+ - **Its own safety screen:** the 9b classifier on the same oMLX server reads
248
+ every request; rules only refuse. In our tests, of 327 labelled sensitive
249
+ requests, the 9b alone let 2 run locally, against 19 for the 4b classifier
250
+ on Ollama; two rules written after reviewing those rows bring this path to
251
+ 0, so 0 is not an out-of-sample figure. Of 294 routine requests, 2 were
252
+ escalated (27 on Ollama). Of 135 adversarial probes, 3 ran locally, all one
253
+ shape (a documentation field).
254
+ - **Speed and cost:** a classifier read took about 0.37 s at the 95th
255
+ percentile on an idle machine and up to 0.65 s under load. The first read
256
+ after a long idle took 14.5 s, because macOS had paged the classifier out,
257
+ so Prism waits up to 90 s for it instead of refusing. The classifier holds
258
+ about 9.2 GB while loaded (9.7 GB peak).
259
+ - **Fails closed:** a classifier failure, an unreadable answer or a missing
260
+ model refuses the call; it never falls back to a keyword check or to
261
+ Ollama. A long prompt is read whole, in windows, not as an excerpt.
262
+ - **Frees memory first:** Ollama's loaded models are unloaded before the call
263
+ (they reload on the next Ollama call), so the two runtimes do not hold large
264
+ models at once.
265
+ - **Layer 1, every path:** a request that decides whether signed-out,
266
+ anonymous or guest users may reach a route, page or endpoint (granting or
267
+ blocking it), makes one public, or gives them admin rights is marked
268
+ reserved by rule, and so is code that exchanges an authorization code for
269
+ tokens. Measured on the 327 sensitive requests on
270
+ the default Ollama path: 18 now run locally, against 19 before; routine
271
+ escalations are unchanged (27 of 294).
272
+
173
273
  ## What's New in v20.21.27
174
274
 
175
275
  **Why it matters:** a script that feeds Prism Browser through a pipe can