Repository navigation
feat(typesafe): serve decisions from Ollama on a private-network host - #12
Merged
Merged
Conversation
Ollama 0.35 serves decision models (tev1, nimble) at /v1/systemone, the System One wire the TypeSafe provider already speaks. Two things kept the plugin from using it: baseUrl accepted only loopback, and the wire model was always the selected kev-latest label, while Ollama routes by model name. baseUrl now also admits private IPv4 literals (RFC 1918 and Tailscale's 100.64/10; no hostnames, no leading-zero octets). A new localModel setting replaces the wire model for a local baseUrl, and model IDs admit Ollama's name:tag colon so the reported model validates. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The GPU machine
minisforum3090(192.168.2.17) now runs Ollama 0.35.1 withtev1:4b, Together AI's experimental 4B decision model. Ollama 0.35 serves decision models at/v1/systemone, the same System One wire format the bundled TypeSafe decision provider already speaks. The plugin couldn't use it for three reasons:baseUrlaccepted only loopback origins.modelwas always the selected label (kev-latest). Kev ignores that label, but Ollama routes by model name, so the request would name a model Ollama doesn't have.:, so Ollama's reportedtev1:4bfailed result validation.Solution
baseUrlalso accepts private IPv4 literals:10/8,172.16/12,192.168/16, and100.64/10for Tailscale. It still rejects hostnames other thanlocalhost(so DNS can't move the endpoint), public addresses, and leading-zero octets (URL parsing reads those as octal). The SSRF guard already trusts exactly the configured origin throughallowedOrigins.localModelsetting replaces the wire model whenever a localbaseUrlis set.typesafe/kev-lateststays the selected decision model.:, in both requests and results.docs/plugins/typesafe.md(new "Ollama decision models" section), anddocs/fork-features.txtare updated to match.Evidence
plugin.register→provider.evaluate) against the realhttp://192.168.2.17:11434:status: ok,model: tev1:4b, typed choice/score/boolean answers with probabilities, 825 input tokens, 3.0 s including the cold import. Warm direct calls to/v1/systemonetake about 0.26 s.extensions/typesafetests: 10 files, 169 passed. They cover new accept and reject cases for private and public addresses, andlocalModelsubstitution against a private origin with thename:tagresult. Measured cost: the extension suite took about 20 s wall locally, and the new cases are synchronous or fetch-stubbed.tsgo:extensionsandtsgo:extensions:testare clean.oxlint,oxfmt --check,check-fork-features(84 present) andgit diff --checkare clean.config:docs:checkalready fails onmain(core 2477 > 2473, plugin 4453 > 4431, plus a hash mismatch). This change adds one plugin entry (localModel, 4454). The baseline is not regenerated here, because regenerating would absorb the unrelated drift.Impact
Evidence submitted to
decision_evaluatenow goes to the configured private-network host. That is the explicit operator choice inbaseUrl, and its own docs say so. Hosted Jev and loopback Kev behave as before.🤖 Generated with Claude Code