fava-trails icon indicating copy to clipboard operation
fava-trails copied to clipboard

feat: support local Laya Typed decisions through Unsloth

Open timeleft-- opened this issue 2 months ago • 8 comments

Problem Statement

FAVA Trails can review promotions through the decisions Trust Gate policy, but the shipped transport is tied to OpenRouter's hosted Jev endpoint. Operators who already have hardware capable of running Unsloth's small Laya decision model must still pay for remote Decisions requests.

Unsloth Desktop now serves Laya locally through a Jev-compatible Decision API. FAVA should expose that existing local option through its normal per-machine Trust Gate configuration, just as it already does for local Unsloth llm-oneshot, without adding runtime discovery, model management, fallback routing, or another credential system.

The recommended local model is Unsloth's Typed decisions variant. Its documented API model identifier is laya-typed-decisions; the generic laya alias must not be hardcoded or presented as the selected model.

Solution

Allow the existing decisions policy to call an explicitly configured local Unsloth Decision API at /v1/systemone. Reuse the existing machine-local Trust Gate provider, model, API-base, credential-file or credential-environment, and timeout settings. Keep the model operator-configurable, with laya-typed-decisions as the recommended example.

OpenRouter Jev remains supported and continues using its existing Decisions endpoint. The operator selects exactly one backend. FAVA never probes localhost, silently switches providers, or falls back from local Laya to OpenRouter.

Whenever operator-facing setup or missing-credential guidance mentions obtaining or configuring an OpenRouter API key for Decisions review, it must also present local Unsloth/Laya as the no-per-request-cost alternative.

After implementation, run one replay of the existing private Trust Gate corpus to measure how Laya Typed decisions performs. If the observed probability distribution or disagreements show a real need, tune the configured Noul question or threshold and rerun once. This is product evidence, not a new validation platform.

User Stories

  1. As a FAVA operator with suitable local hardware, I want to use Laya for Decisions review, so that I do not pay OpenRouter for every Trust Gate promotion.
  2. As a FAVA operator, I want local Laya presented whenever setup asks for an OpenRouter API key, so that I know a local alternative exists before creating a paid-provider credential.
  3. As a FAVA operator, I want to select the backend explicitly, so that FAVA never changes approval authority based on environment discovery.
  4. As a FAVA operator, I want exactly one Decisions backend active at a time, so that the destination and authority of each review remain understandable.
  5. As a FAVA operator, I want to configure the exact local model identifier, so that FAVA does not hide my selected Laya variant behind a generic alias.
  6. As a FAVA operator, I want laya-typed-decisions to be the recommended local model example, so that the documented configuration matches the variant selected for Trust Gate evaluation.
  7. As a FAVA operator, I want model selection to remain part of ordinary per-machine Trust Gate configuration, so that changing models does not require a code change.
  8. As a FAVA operator, I want local Decisions to reuse the provider, API-base, credential, and timeout settings already used by local llm-oneshot, so that there is no second local-model configuration system.
  9. As a FAVA operator, I want owner-only credential files to work for local Decisions, so that I can use the same credential boundary as local llm-oneshot.
  10. As a FAVA operator, I want the existing API-key environment-variable option to remain available, so that service-managed environments can inject the credential in the established way.
  11. As a FAVA operator, I want FAVA to send local Decisions requests to Unsloth's documented /v1/systemone endpoint, so that no proxy or adapter daemon is required.
  12. As a FAVA operator, I want the configured model identifier forwarded unchanged, so that laya-typed-decisions reaches the runtime exactly as configured.
  13. As a FAVA operator, I want the existing Trust Gate prompt, thought content, selected metadata, and Noul question sent through the local Decision API, so that local and hosted Decisions judge the same material.
  14. As a FAVA operator, I want the configured Noul threshold applied identically to local and hosted responses, so that backend location does not change Verdict semantics.
  15. As a FAVA operator, I want local response failures to fail closed, so that an unavailable or malformed local service cannot approve a thought.
  16. As a FAVA operator, I want local failure to stop without contacting OpenRouter, so that the system does not create an unexpected charge or data-egress event.
  17. As a FAVA operator, I want doctor and startup diagnostics to identify the loopback Decision endpoint as local, so that I can confirm the effective destination without exposing credentials.
  18. As a FAVA operator, I want diagnostics to name the configured provider and model, so that configuration errors are understandable.
  19. As an auditor, I want durable Trust Gate provenance to record the Decisions policy, configured local provider, returned or configured model, Noul probability, threshold, and timestamp, so that the Verdict remains reconstructable.
  20. As an auditor, I want provenance and diagnostics to exclude credential values, credential paths, and unsanitized provider errors, so that local configuration does not leak secrets.
  21. As an existing OpenRouter Jev operator, I want the current hosted endpoint and behavior preserved, so that adding local Laya does not break my installation.
  22. As a maintainer, I want local Laya exercised through the existing end-to-end propose_truth seam, so that tests cover real promotion, rejection, returned JSON, and durable provenance rather than private helper behavior.
  23. As a maintainer, I want the local HTTP test service to implement Unsloth's documented request and response contract, so that automated tests require no model download, GPU, real credential, or network access.
  24. As a maintainer, I want one replay of the existing private Trust Gate corpus, so that we know how Typed decisions performs on the actual gate workload.
  25. As a maintainer, I want replay results to show agreement, false approvals, false rejections, failures, latency, probability distributions, and disagreements, so that any tuning decision follows observed behavior.
  26. As a maintainer, I want at most one follow-up replay after justified Noul question or threshold tuning, so that evaluation does not grow beyond the feature.
  27. As a maintainer, I want the private corpus kept out of the repository and CI, so that this issue does not create a benchmark platform or publish private records.

Implementation Decisions

  • Extend the existing Decisions transport rather than adding a parallel local-review subsystem.
  • Reuse the existing per-machine Trust Gate configuration boundary. The recommended example selects the decisions policy, the existing local openai provider value, the exact model laya-typed-decisions, the operator's loopback Unsloth API base, the existing credential file or credential environment variable, the existing timeout, and the existing Noul question and threshold block.
  • Do not add an unsloth provider value solely for this feature.
  • Do not hardcode laya, laya-typed-decisions, or any other model in runtime logic. The model is always read from trust_gate_model; documentation recommends laya-typed-decisions.
  • When the decisions policy uses the existing local provider configuration, send the request to the configured Unsloth base at /v1/systemone.
  • When the decisions policy uses OpenRouter, preserve the existing /api/alpha/decisions behavior.
  • Keep the existing Decisions request state unchanged: full scope-resolved Trust Gate prompt, full thought content, selected metadata, and exactly one configured Noul question.
  • Forward the configured model identifier exactly, without chat-model alias rewriting.
  • Accept the documented Laya Noul response shape. Optional provider and response-id fields must not be required.
  • Continue approving when the returned Noul probability is at or above the configured threshold and rejecting below it.
  • Reuse the current owner-only credential-file and credential-environment behavior. Keyless mode and new credential fields are not part of this issue.
  • Preserve fail-closed handling for connection, authentication, timeout, non-success HTTP, malformed JSON or schema, missing answer, wrong answer type, non-numeric probability, and out-of-range probability failures.
  • Never contact an unconfigured provider after local failure.
  • Keep structured provenance and secret-free egress disclosure. A loopback Unsloth URL is classified as local_endpoint; OpenRouter remains remote_provider.
  • Update operator-facing setup and missing-credential guidance so local Laya is presented before or alongside instructions to obtain an OpenRouter key.
  • Do not install, start, stop, supervise, repair, upgrade, or probe Unsloth.
  • Implement first, then run one corpus replay. Tune only the configured Noul question or threshold if observed results justify it, followed by no more than one rerun.

Testing Decisions

  • Use the existing end-to-end propose_truth Decisions tests as the primary behavioral seam. A test starts from a saved draft, submits it to a synthetic local /v1/systemone service, and verifies approval or rejection, returned tool JSON, promotion state, egress disclosure, and durable provenance.
  • Extend the existing in-process Decisions HTTP fixture to represent both OpenRouter Jev and local Unsloth Laya contracts. Do not create a separate framework.
  • Verify that local configuration sends exactly one request to /v1/systemone, forwards laya-typed-decisions unchanged, includes the established state and one Noul question, and uses the existing bearer credential behavior.
  • Verify approval below, at, and above the configured threshold through the highest seam where practical.
  • Verify local connection, authentication, timeout, malformed-response, missing-answer, and invalid-probability failures fail closed and make zero OpenRouter requests.
  • Verify provenance identifies the configured local provider and served or configured model while excluding credentials, credential paths, and raw exception text.
  • Verify doctor, gateway startup, and tunnel startup identify the loopback destination as local and avoid OpenRouter-only repair instructions.
  • Keep all existing OpenRouter Decisions behavior and tests passing, including its endpoint, exact model forwarding, threshold mapping, fail-closed behavior, and provenance.
  • The live quality check is a single evidence task outside CI. Run the existing private corpus once against laya-typed-decisions; report total cases, expected-outcome agreement, false approvals, false rejections, invalid or failed responses, median and maximum latency, probability distributions, and individual disagreements.
  • If those results justify changing the Noul question or threshold, record the reason, make one adjustment, rerun the same corpus once, and retain both result summaries.

Out of Scope

  • Installing, downloading, configuring, starting, stopping, supervising, repairing, or upgrading Unsloth
  • Automatic localhost probing or runtime discovery
  • Automatic provider selection or provider fallback
  • Adding an unsloth provider value when the existing local provider configuration already covers the runtime
  • Keyless API support or a new credential mechanism
  • Supporting or recommending laya, laya-multilingual, or laya-english in this first issue
  • Supporting additional local Decision runtimes
  • A proxy, adapter daemon, routing layer, or multiple simultaneous Trust Gates
  • A reusable benchmark framework, continuous evaluation service, dashboard, or observability stack
  • Publishing the private replay corpus or adding it to CI
  • More than one justified tuning rerun
  • Changing the existing binary Verdict domain
  • Changing human operator approval semantics
  • Changing OpenRouter Jev calibration or existing hosted behavior

Further Notes

  • This is a follow-up to issue #123 and merged PR #128, which established the decisions policy and OpenRouter Jev transport.
  • Unsloth documents laya-typed-decisions as its English-only Typed decisions model and exposes local Decision requests through /v1/systemone.
  • The Infra YAGNI verdict is PASS only for this thin adaptation of an existing local API. The design is falsified if implementation makes FAVA own Unsloth's lifecycle, adds a proxy or router, mutates privileged host state, exposes the service publicly, adds silent fallback, or builds a general evaluation platform.
  • Rollback is configuration-only for operators: explicitly select the prior OpenRouter provider, model, API base, and credential. The implementation itself can be reverted without a schema or data migration.

timeleft-- avatar Sep 29 '26 16:09 timeleft--

Epic status

  • #131 is complete: PR #135 was independently reviewed at exact head, approved, passed CI, and merged as 6678c4d788044e73ac7df1c9e9c032741ec052c2.
  • #133 is complete: the existing 53-case private corpus was replayed once against local laya-typed-decisions; aggregate report is on the ticket.
  • #132 remains open: the exact merged FAVA runtime and a separate FAVA-owned Unsloth service are installed and configured in the local test installation, and a fresh MCP client routes to local /v1/systemone with no cloud fallback. The required successful promotion is blocked because Unsloth rejects the full production-shaped Trust Gate state with HTTP 422 when it exceeds the model's 1024-token context.

No threshold or Noul-question tuning was performed because the model returned no probabilities. Fixing this would require a new decision about reducing/truncating the prompt or candidate state, which conflicts with this epic's explicit requirement to send the established full state and is not being smuggled into the ops/calibration tickets.

The epic remains open with #132 active. Other model services were not modified.

timeleft-- avatar Sep 29 '26 21:09 timeleft--

Final configuration-only check: the smallest real Trust Gate corpus state is 1,180 tokens before question/head syntax, versus Typed Decisions’ 1,024-token limit. A minimal three-token Noul question still cannot fit. This proves question or threshold tuning cannot complete #132 while preserving this epic’s required full prompt, full thought, selected metadata, and one question.

Implementation, review, merge, local installation, explicit routing, no-cloud-fallback behavior, and the one corpus replay are complete. The epic remains open solely because the required successful full-state promotion is incompatible with the selected model context window. Unrelated installations were not modified.

timeleft-- avatar Sep 29 '26 21:09 timeleft--

Local decision-model serving: longer-context Laya and alternatives

Research date: 2026-09-29.

This note answers two questions raised while adding local Trust Gate support:

  1. Can Laya Typed Decisions run with more than its published 1,024-token context?
  2. Which other true decision models can Unsloth or Ollama serve locally while preserving FAVA's Jev-compatible POST /v1/systemone contract?

The short answer is:

  • Laya Typed Decisions can mechanically run beyond 1,024 tokens. Its ModernBERT-large encoder supports 8,192 positions, and the upstream Laya runtime explicitly permits a larger max_len. The published checkpoint was trained and calibrated with max_len: 1024, however, so longer-context answer quality and calibration are not established by the published checkpoint.
  • Unsloth does not expose a context control for Decision API models. Its current runtime reads max_len from a Laya checkpoint's rl_agent_config.json. Therefore a local copy of the Typed Decisions checkpoint with max_len raised to 2,048 is technically loadable through Unsloth's existing local-checkpoint path, but this is not a documented Desktop setting or a stock model choice.
  • Stock Ollama cannot serve Laya's decision head or the System One API. It does now distribute purpose-trained decision models—Tev1 and Nimble—and can run other decoder-based decision fine-tunes such as Hmm. They use Ollama's generation API, however, so FAVA still needs an adapter to expose /v1/systemone and turn answer-token logits into the Jev response shape.
  • Unsloth's native Decision API currently supports only the three Laya checkpoints. For a broader native decision-model catalog, Ollaya—not Ollama—is the purpose-built alternative and already exposes the correct API.

1. Laya Typed Decisions beyond 1,024 tokens

The three different limits

Layer Current value What it means
Encoder architecture 8,192 ModernBERT-large's max_position_embeddings; the model can construct attention positions up to this length.
Published Typed Decisions checkpoint 1,024 max_len in the checkpoint's rl_agent_config.json; this is the sequence length used by the released decision runtime and training configuration.
Unsloth stock catalog 1,024 The context advertised for laya-typed-decisions; Unsloth loads the checkpoint configuration rather than exposing an independent context setting.

The Typed Decisions checkpoint configuration sets max_len to 1,024 and head_max_len to 256. Its encoder is answerdotai/ModernBERT-large. That encoder's official configuration sets max_position_embeddings to 8,192 and uses RoPE parameters for local and global attention.

The upstream Laya documentation explicitly says callers may raise agent.cfg["max_len"] to 2,048, 4,096 or 8,192. Laya's Python API also accepts per-call max_len and head_max_len overrides in Agent.predict_batch. This means 1,024 is not an immutable architecture limit.

What Unsloth actually does

Unsloth's Decision API catalog contains exactly three built-in checkpoints: Laya multilingual (1,024), English (512), and Typed Decisions (1,024). The same catalog also accepts a local Laya checkpoint directory.

The Unsloth Laya runtime reads max_len and head_max_len directly from the loaded agent's checkpoint configuration. It does not apply a separate 1,024-token ceiling. It tokenizes the state to the available space and reports whether any state tokens were dropped. The HTTP route then converts any such truncation into HTTP 422 rather than returning a decision made from incomplete state.

Consequently, a local checkpoint directory containing the released Typed Decisions weights plus a modified rl_agent_config.json with, for example, "max_len": 2048 should run through the existing Unsloth code path. This is an inference configuration change; it does not require changing tensor shapes or retraining merely to execute because the encoder already supports longer positions.

It is not currently a supported control in the Unsloth Desktop documentation. The official Unsloth guide only presents the three fixed model choices and describes the multilingual checkpoint as 1,024-token context. There is no documented Decision API request field, UI setting or environment variable for overriding max_len on a built-in checkpoint.

Training and calibration implications

Running and trusting are separate questions.

  • The released Typed Decisions configuration records max_len: 1024, and its decision head was fine-tuned under that budget. Tokens beyond that range were not part of the published training setup.
  • Raising max_len lets attention reach the additional state instead of truncating it, but there is no published long-context result for the Typed Decisions checkpoint. Accuracy can therefore move in either direction.
  • The shipped temperature and temperature_by_options values were fitted to the published checkpoint behavior. A longer input distribution can change calibration even when the top answer remains correct.
  • Retraining is not required for a first functional trial. If a 2,048-token configuration clears the current 422 errors, the existing Trust Gate corpus is the right evidence for deciding whether the current Noul threshold remains useful. Fine-tuning or refitting temperature is justified only if that replay shows a real quality or calibration problem.

For FAVA's one short noul question, there is no reason to increase head_max_len from 256: doing so reserves more of the sequence for question text and leaves less for state. Raising only total max_len to 2,048 is the smallest plausible experiment.

Fit against FAVA's existing corpus

A local tokenizer-only measurement of the same 53 production-shaped Trust Gate cases, using the shipped Noul question and head_max_len: 256, produced:

Total context Cases that fit without truncation
1,024 0 / 53
2,048 32 / 53
4,096 38 / 53
8,192 46 / 53

The smallest case is 1,225 tokens including the question head. The largest is 33,927 tokens. Therefore 2,048 is sufficient to test real FAVA promotions and remove the current all-cases-fail condition, but it is not enough to make the entire existing corpus fit. Even the encoder's 8,192-position ceiling leaves seven unusually long cases requiring an explicit product policy for long records.

A non-persistent local probe then loaded the installed Typed Decisions weights, changed only the in-memory max_len to 2,048, and evaluated the smallest real case. The model processed 1,226 input tokens and returned noul: 0.6541. This confirms that the released tensors execute beyond 1,024 tokens without a model rewrite. It does not establish quality: that case's reference outcome is reject, while FAVA's current 0.45 threshold would approve it. The result is one observation, not a replacement for the corpus replay.

2. What Unsloth can serve as a decision model

Native /v1/systemone support

Unsloth's native decision transport is Laya-specific. The current source catalog and official guide support:

Unsloth model Architecture Published context Native FAVA transport
laya-english ModernBERT-large + Laya decision head 512 Yes
laya-multilingual mmBERT-base + Laya decision head 1,024 Yes
laya-typed-decisions ModernBERT-large + fine-tuned Laya decision head 1,024 Yes
Local Laya checkpoint directory Same file/layout contract as Laya Checkpoint-defined Yes

The local-checkpoint hook does not make Unsloth a generic decision-model server. Its loader expects Laya's rl_agent_config.json, tokenizer, encoder directory, and decision tensors. Models with another custom head—Kev, AgentJev, Ballot, Winnow, Von, and similar projects—need their own runtime integration even when their backbone is one Unsloth can otherwise load for text generation.

Unsloth's ordinary OpenAI-compatible chat/completions service is also not a substitute. A generative response containing true or a label does not provide the Jev response schema, calibrated noul, per-option probabilities, or the non-generative decision-head computation that FAVA's Decisions transport expects.

3. What stock Ollama can and cannot serve

Laya itself

Laya is not an autoregressive GGUF chat model. It combines a ModernBERT or mmBERT encoder with a custom decision head that scores option-marker hidden states. Ollama's import documentation accepts Safetensors directories and GGUF files for architectures its runners implement, but it does not implement Laya's model class, input layout, or answer decoder. Putting Laya weights into a directory or GGUF container would not add that runtime behavior.

Ollama's documented API likewise has no POST /v1/systemone. Its OpenAI-compatibility reference lists chat completions, completions, models, embeddings and Responses. These produce text, embeddings or token log probabilities—not Jev's typed decision response.

Therefore stock Ollama is not compatible with FAVA's Decisions transport for Laya, even if a future converter made the encoder tensors importable.

Decision models in Ollama's own library

Ollama currently distributes two purpose-trained decision families:

Ollama model Published context Native behavior FAVA compatibility
tev1 256k Qwen3.5-based model that returns one option letter; 0.8B and 4B variants Needs an adapter; no /v1/systemone or native Jev probability object
nimble 8,192 Qwen3.5-9B decision model that returns one letter for one requested field Needs an adapter; the Ollama packaging is chat/generation, not Nimble's native scorer API

Together AI's Tev1 model card calls it a Jev-inspired experiment rather than a non-autoregressive Jev runtime: it retains Qwen's next-token language-model head. Its answer-letter distribution can be recovered from token probabilities, but stock Ollama does not compile a Jev request, map answer labels, or return a calibrated noul object for the caller.

Bespoke Labs' Nimble repository does contain a genuine candidate scorer and a native /v1/systemone server that returns per-answer probabilities. The nimble Ollama package, by contrast, documents a fixed chat prompt and a single-letter response for one field at a time. Running Nimble through Ollama therefore gives local inference, but not FAVA's transport contract. Running Bespoke's own server is the contract-compatible route and would be a new serving backend.

Ollama's /api/generate endpoint can return output-token logprobs and top_logprobs. That is enough raw data for a separate adapter to normalize option probabilities for Tev1 or the Ollama form of Nimble. It is not itself a Jev implementation, and those token probabilities should not be treated as calibrated decision confidence without model-specific evidence.

Another decision model that can use Ollama as its low-level runner

Another documented option is n4ze3m/Qwen3.5-4B-Hmm, a Qwen3.5-4B decision fine-tune published as GGUF. Its official repository documents:

  • running the GGUF in Ollama 0.12.11 or newer because the adapter needs log probabilities;
  • a separate Bun server that calls Ollama and exposes POST /v1/systemone;
  • noul, choice, and score answers with probabilities; and
  • a candid limitation that it was trained on prompts up to 768 tokens and does not match Jev on its reported benchmarks.

This is Ollama-backed, not native Ollama API compatibility. FAVA would point to the Hmm adapter's port, not to Ollama's port 11434. It is also much larger than Laya and uses one decoder pass per question, so it gives up Laya's small encoder and single-pass multi-question advantages.

Other open System One projects publish GGUF or Qwen-based weights, but loading their backbone in stock Ollama is not enough when they require a custom pointer head, endpoint head, prompt construction, option-logit extraction, temperature calibration, or a /v1/systemone adapter. No primary source reviewed here documents another stock-Ollama-to-Jev path as complete as Hmm's.

4. The broader local catalog is in Ollaya, not Ollama

ollaya is a separate Apache-2.0 local decision-model daemon whose name deliberately mirrors Ollama. It natively serves POST /v1/systemone, /v1/decisions, and /v1/models; it is not an Ollama plugin or endpoint.

Its current first-party catalog includes Laya, Winnow, Decider, Kev, Decision 1.0 Eos, Qwen3Guard, NLI models, GLiClass, Von, CLM and JevK5. Some use ONNX Runtime and others use a bundled llama.cpp runner, but Ollaya performs the model-specific prompt/head/calibration work rather than assuming a chat API is a decision API. Not every catalog entry is a fully general Jev replacement: Qwen3Guard and NLI models, for example, have narrower semantics. The relevant general typed-decision candidates are:

Candidate Runtime described by its server Context note /v1/systemone
Laya Typed Decisions ONNX/PyTorch-derived decision runtime 1,024 published; longer inference possible as discussed above Yes
Winnow E4B / 12B llama.cpp over author GGUF Model-specific Yes, through Ollaya
Kev 0.8B / 4B / 9B ONNX or model-specific packed runtime Model-specific Yes, through Ollaya
Decider 0.8B / 2B / 4B ONNX decision runtime Model-specific Yes, through Ollaya
Decision 1.0 Eos Endpoint-head decision runtime 16k training rows reported by Ollaya Yes, through Ollaya
Von 1.1 ModernBERT decision runtime 8k Yes, through Ollaya

This catalog is useful for future comparison, but adopting Ollaya would be a serving-backend change rather than a model swap inside the Unsloth work already approved for issue #129.

Recommendation for issue #129

The least disruptive next step is to keep the already selected model and API:

  1. Make a local copy of the released laya-typed-decisions checkpoint.
  2. Change only max_len from 1,024 to 2,048; keep head_max_len at 256.
  3. Select that directory through Unsloth's existing local Laya checkpoint path.
  4. Confirm a real production-shaped promotion now reaches a decision.
  5. Re-run the same Trust Gate corpus once and inspect the 32 cases expected to fit, including Noul probabilities and decision agreement, before changing the threshold.

That experiment answers the immediate context failure without adding another server or substituting a generative chat model. It will not make all 53 cases fit. If its decisions are poor at the longer length, or if full-corpus coverage is required, the next choices are an explicit long-record policy, long-context fine-tuning/calibration, Bespoke's native Nimble server, or a broader serving change such as Ollaya—not pretending stock Ollama's chat API already satisfies the contract.

timeleft-- avatar Sep 29 '26 22:09 timeleft--

Local Laya Typed Decisions at 8,192 tokens

Measured on September 29, 2026, for issue #129.

Result

Increasing the context window makes real FAVA requests executable: 46 of the existing 53 corpus cases returned valid Noul probabilities. Seven still exceeded the context window and returned HTTP 422.

Threshold calibration did not produce a useful automatic promotion gate. Every returned score exceeded the inherited Jev threshold of 0.45. The highest reference-approval score (0.6632) was below the highest reference-rejection score (0.6692), so any threshold that excludes every observed false approval also excludes every observed true approval.

The machine-local threshold is now 0.67: the smallest two-decimal threshold above every observed rejection score. This prevents the observed false approvals, but rejects all 46 scored cases. It is a protective configuration, not a successful quality calibration. The remaining seven requests fail closed.

Configuration used for the local trial

  • FAVA runtime: merged PR #135, commit 6678c4d788044e73ac7df1c9e9c032741ec052c2.
  • A dedicated local Unsloth service served the checkpoint over loopback.
  • Model identifier remains laya-typed-decisions.
  • Copied checkpoint revision: 55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851, typed-decisions subdirectory.
  • Changed only checkpoint max_len from 1024 to 8192; head_max_len remains 256 and weights/temperatures are unchanged.
  • The FAVA service uses a dedicated Hugging Face cache containing this copy, with offline loading so the modified configuration remains pinned.
  • The original shared checkpoint still records max_len: 1024.
  • The FAVA-owned Unsloth service was restarted. Its short API smoke request returned the expected model and a valid Noul answer.
  • A fresh installed FAVA configuration loader verified the local endpoint, model, question, and 0.67 threshold.
trust_gate: decisions
trust_gate_provider: openai
trust_gate_model: laya-typed-decisions
trust_gate_api_base: "http://127.0.0.1:<UNSLOTH_PORT>/v1"
trust_gate_timeout_secs: 240
trust_gate_decisions_config:
  trust_gate_noul_question: "Should this candidate be promoted as durable, high-quality institutional memory under the supplied Trust Gate policy?"
  trust_gate_noul_threshold: 0.67

In the configuration example above, replace <UNSLOTH_PORT> with the configured local service port. The existing credential-file setting is retained. Already-running FAVA MCP processes cache configuration; reconnect them to load the new threshold.

Corpus measurement

The same deterministic corpus contains 13 historical rejects, 26 historical approvals, 10 synthetic canaries, and four boundary rejects. Reference labels are existing judgments, not independently verified ground truth. The four synthetic approval canaries also failed at the selected threshold.

Requests used the installed production _build_decisions_state and DecisionsClient.ask_noul implementations, sending the full prompt, full thought, selected metadata, and unchanged question to /v1/systemone.

Outcome Count
Requests 53
Valid probabilities 46
HTTP 422 failures 7
Scored reference approvals 23
Scored reference rejections 23
Reference approvals that exceeded context 7
Reference label Minimum Median Maximum
Approve 0.5460 0.6125 0.6632
Reject 0.5733 0.6530 0.6692
Threshold True approvals False approvals True rejections False rejections Agreement on scored cases
0.45 23 23 0 0 23/46
0.67 0 0 23 23 23/46

These are Noul threshold mappings, rather than a claim that every case bypasses FAVA's other promotion checks. All six rejection canaries and all four boundary rejects scored above 0.45, including the injection, unsupported-claim, sensitive-information, and transient-status examples. At 0.67, all fourteen canary/boundary cases are rejected, including the four expected approvals.

Latency on successful requests: median 1.350s, maximum 16.408s. Across all requests: median 1.568s, maximum 37.440s.

Thresholds were swept over the cached probabilities. Since the threshold is applied after inference, this needs no second model replay. Neither the Noul question nor model temperature was changed.

Private per-case results and the threshold sweep are retained separately with owner-only permissions; private thought bodies are not included in this report or public comments.

Implication for the epic

The original all-requests-fail context problem is resolved for 46 cases. Automatic promotion remains unsuitable under the measured question/model combination: threshold adjustment alone cannot preserve useful approvals while excluding all observed false approvals. Issue #132's required successful, useful promotion is not established by this run.

Rollback copies of the prior service and FAVA configuration are preserved privately. The dedicated checkpoint and installed settings are local operational changes; product source and shared data-repository defaults were not changed.

timeleft-- avatar Sep 29 '26 22:09 timeleft--

Laya Typed Decisions: 4,096 versus 8,192 tokens

Measured September 29, 2026, for issue #129.

The requested 4,096-token trial did not improve the Trust Gate decisions. All 38 cases that returned probabilities at both lengths had exactly identical scores, to the four decimal places returned by the API. Maximum observed score change was zero. Case identities and body hashes matched across runs.

Context limit Valid probabilities HTTP 422 context failures
8,192 46/53 7/53
4,096 38/53 15/53

The full prompt, thought content, selected metadata, question, model weights, temperature, and model identifier were unchanged. Only checkpoint max_len changed to 4096; head_max_len remains 256. The dedicated local Unsloth service was restarted before the replay. It continues to use the isolated checkpoint copy created for the previous run, with the loaded configuration now specifying 4096.

At 4,096, the scored cases contain 15 reference approvals and 23 reference rejections. The other 15 reference approvals exceed context and fail closed. Existing labels remain reference judgments, rather than verified ground truth.

Threshold True approvals False approvals True rejections False rejections among scored cases
0.45 15 23 0 0
0.67 0 0 23 15

The highest reference-approval score is still 0.6632, below the highest reference-rejection score of 0.6692. No threshold retains an observed true approval while excluding every observed false approval. All fourteen canary/boundary cases also have unchanged scores; the four expected approval canaries are rejected at 0.67.

The existing machine-local threshold remains 0.67. It excludes the observed false approvals but also excludes all observed true approvals. This trial does not establish a useful automatic promotion gate.

Successful-request latency: median 1.130s, maximum 5.083s. Across all 53 requests: median 1.589s, maximum 6.879s. These measurements include different coverage from the 8,192-token run; they are not a controlled speed comparison on identical successful inputs.

The service is left at max_len: 4096 as requested. The installed FAVA provider, model, endpoint, Noul question, and threshold remain unchanged. No fallback is configured. Private results and comparison data are retained separately with owner-only permissions.

The unchanged scores show that reducing the maximum context alone does not resolve this model/question combination's poor separation on the Trust Gate corpus. It decreases coverage by eight cases.

timeleft-- avatar Sep 29 '26 22:09 timeleft--

Operator decision: restore OpenRouter Jev and defer local model adoption

The local FAVA installation now explicitly selects OpenRouter Jev with the calibrated Noul threshold 0.45. The calibrated question is unchanged.

trust_gate: decisions
trust_gate_provider: openrouter
trust_gate_model: "~typesafe/jev-latest"
trust_gate_api_base: https://openrouter.ai/api
trust_gate_decisions_config:
  trust_gate_noul_question: "Should this candidate be promoted as durable, high-quality institutional memory under the supplied Trust Gate policy?"
  trust_gate_noul_threshold: 0.45

The existing OpenRouter credential environment is restored; FAVA no longer selects the local Unsloth endpoint or its credential file. This is an explicit operator backend selection, with no automatic fallback.

A fresh installed FAVA configuration loader verified the provider, model, endpoint, question, threshold, and credential availability. One small live Decisions request succeeded and returned typesafe/jev-1.13-20260917, the model identity in the existing calibration report. That report selected 0.45 with 23 true approvals, zero observed false approvals, 23 true rejections, and seven false rejections against the reference labels. The corpus was not replayed again for this configuration restoration.

Local Decisions adoption is deferred until Unsloth supports a model suitable for this Trust Gate workload. The merged Unsloth integration remains available. The 4,096- and 8,192-token Laya trials did not provide useful score separation. We will not add Ollama's generated-letter adaptation or adopt Ollaya as part of this epic. This decision creates no recurring monitoring job or additional model trials.

Already-running FAVA MCP processes cache configuration and need reconnection to load this selection. The epic's local-model acceptance remains deferred; normal use returns to the measured OpenRouter Jev configuration.

timeleft-- avatar Sep 29 '26 23:09 timeleft--

The ChatGPT tunnel MCP server is now also using OpenRouter Jev with the calibrated Trust Gate setup.

  • Switched the dedicated gateway from Gemini/LLM Oneshot to decisions, provider openrouter, model ~typesafe/jev-latest.
  • Set trust_gate_noul_threshold: 0.45 and the calibrated question: “Should this candidate be promoted as durable, high-quality institutional memory under the supplied Trust Gate policy?”
  • Upgraded its FAVA runtime to revision 6678c4d788044e73ac7df1c9e9c032741ec052c2 (FAVA 0.7.0) and restarted the MCP service.
  • A live, non-persisted Trust Gate review returned typesafe/jev-1.13-20260917, probability 0.66, and approve at the configured threshold. The actual ChatGPT connector successfully listed FAVA scopes after the restart.
  • Preserved existing records, credentials, and ordinary agent permissions; no operator access or provider fallback was added.

The backend selection is persisted in service configuration. Future service recreations must retain the selected FAVA revision and the Jev configuration documented in the operator decision above. Deployment-specific details are kept out of this public issue.

Local Laya remains deferred pending a suitable Unsloth-served model; no Ollama/Ollaya adapter is being added.

To resume #129 when a suitable Unsloth model becomes available, keep the existing /v1/systemone integration and full Trust Gate input, configure the new model explicitly, and replay the same 53-case corpus privately. Compare aggregate coverage, false approvals/rejections, and score separation against the recorded Laya trials and Jev calibration before selecting a threshold. A useful full-state promotion remains the unmet acceptance criterion for #132; the integration and calibration work are already recorded in #131 and #133.

timeleft-- avatar Sep 30 '26 10:09 timeleft--