Skip to content

feat(adapter/typed-decision-local): local model backend for contract:typed-decision (llama.cpp / Ollama / vLLM) #1431

Closed

Description

@onlyarnav

Goal: A local-model backend adapter for \contract:typed-decision\ (\ ools/typed-decision/), supporting llama.cpp, Ollama, or vLLM endpoints.

Why: PR #1402 introduced the \contract:typed-decision\ interface with TypeSafe Jev API as the initial cloud backend. Providing a local-model backend enables offline, zero-egress structured decisions without third-party network calls and establishes a second independent backend for vendor neutrality.

What it needs to do (see \ ools/typed-decision/tool.md\ § Interface):

  • Implement \DecisionProvider\ (\choice, \score,
    oul) against local OpenAI-compatible or Ollama endpoints (e.g. \http://localhost:11434/v1\ or \http://localhost:8080/v1\).
  • Support structured outputs via JSON schema or constrained grammars (e.g. GBNF) for discrete choice selection and bounded scale evaluation.
  • Strictly adhere to \TypedDecisionUnavailable\ fail-open semantics on connection, timeout, or schema failure.

References: \ ools/typed-decision/tool.md, \docs/adapters/registry.md, \docs/vendor-neutrality.md.

Activity

  1. IRONICBo commented on Oct 1, 2026

    @IRONICBo

    One boundary worth making explicit for the local adapter: a loopback URL should stay loopback for the entire request. Disable environment proxies and reject redirects (or re-run the privacy gate against every redirect target); otherwise an approved 127.0.0.1 / localhost endpoint can still forward prompt data to an unapproved host. We hit the same boundary in Jev Social's loopback decision path. A regression with HTTP_PROXY set and a 302 to a non-loopback host would pin it down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions