Skip to content

feat(typesafe): serve decisions from Ollama on a private-network host - #12

Merged
tomorrowflow merged 1 commit into
mainfrom
feat/typesafe-local-model
Oct 4, 2026
Merged

tomorrowflow merged 1 commit into
mainfrom
feat/typesafe-local-model

Conversation

@tomorrowflow

Copy link
Copy Markdown
Owner

Problem

The GPU machine minisforum3090 (192.168.2.17) now runs Ollama 0.35.1 with tev1: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:

  • baseUrl accepted only loopback origins.
  • The wire model was 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.
  • Model IDs rejected :, so Ollama's reported tev1:4b failed result validation.

Solution

  • baseUrl also accepts private IPv4 literals: 10/8, 172.16/12, 192.168/16, and 100.64/10 for Tailscale. It still rejects hostnames other than localhost (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 through allowedOrigins.
  • A new optional localModel setting replaces the wire model whenever a local baseUrl is set. typesafe/kev-latest stays the selected decision model.
  • The model ID pattern admits :, in both requests and results.
  • The manifest schema and UI hints, docs/plugins/typesafe.md (new "Ollama decision models" section), and docs/fork-features.txt are updated to match.

Evidence

  • Live, through the registered provider (plugin.register → provider.evaluate) against the real http://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/systemone take about 0.26 s.
  • extensions/typesafe tests: 10 files, 169 passed. They cover new accept and reject cases for private and public addresses, and localModel substitution against a private origin with the name:tag result. Measured cost: the extension suite took about 20 s wall locally, and the new cases are synchronous or fetch-stubbed.
  • tsgo:extensions and tsgo:extensions:test are clean. oxlint, oxfmt --check, check-fork-features (84 present) and git diff --check are clean.
  • config:docs:check already fails on main (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_evaluate now goes to the configured private-network host. That is the explicit operator choice in baseUrl, and its own docs say so. Hosted Jev and loopback Kev behave as before.

🤖 Generated with Claude Code

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant