Skip to content

[P2][LM-6] Qualify llama.cpp, vLLM and generic Responses servers without new agent engines #382

Open

Description

@BunsDev

Outcome and dependencies

Extend the same native Codex path beyond first-class Ollama/LM Studio profiles using protocol- and capability-based configuration, not separate coding engines.

Parent: #376. Blocked for completion by: #378 (LM-2 connections/discovery), #379 (LM-3 scoped native execution) and #380 (LM-5 local policy). Delivery group: Local models v1 / Gate C. Priority: P2: required for the broad compatibility claim, not the initial Ollama/LM Studio pilot. Follow the shared execution contract in #376.

Context and source entry points

Refresh current main, scoped instructions and accepted producer interfaces. Publication baseline: ec7be578765f9ce54976882853e57ca190252361.
Existing/new producer paths: #378's discovery modules and #379's native profile modules.
Proposed: small metadata presets under apps/desktop/src/main/engine/local-models/, apps/desktop/test/local-model-compatibility.test.ts; extend docs/local-models.md with the versioned compatibility matrix. Reuse the same fixtures and actual app-server path.

Consumes: profiles, qualification evidence schema, native execution and privacy/admission policy. Produces: lightweight presets and reproducible qualification results keyed to exact runtime/model/template/tool-parser/context/native-CLI configuration. This is not an all-models guarantee.

Implementation steps

  • Add lightweight llama.cpp/vLLM presets and retain the manual Custom Responses option. Prefer shared execution; add provider-specific metadata parsing only where it improves accuracy. Arbitrary identifiers remain supported within the existing explicit-loopback endpoint policy.
  • Verify the actual Responses endpoint and native harness tool forms: streamed arguments, tool-result round trips, instructions, reasoning fields and conversation continuation. A Chat Completions endpoint or /models response alone does not establish compatibility. Exercise the app-server integration, not only direct HTTP or an interactive terminal demo.
  • Record model revision/build or digest where exposed, quantization, template/tool parser, effective context, runtime version and native CLI version. Unknown fields remain unknown. Changes invalidate or mark old qualification stale rather than silently reusing a green badge.
  • Document server-side prerequisites and actionable remedies without downloading weights or rewriting the user's server configuration. Cover stateless Responses/history handling and unsupported native tool forms. Do not hide gaps behind a translation proxy or weaken permissions to make a fixture pass.
  • Let other runtime-served models qualify through the same contract without source edits or model-family allowlists. Local MLX/Transformers/other implementations are not automatically supported; qualify their actual endpoint/tool behavior. Show text-only/embedding/unsupported model states honestly; native chat is offered only when its exact path is verified.
  • When a concrete upstream defect blocks an otherwise supported route, record the minimal reproducible failure, exact upstream owner/version and safety impact in [Tracker][LM] Integrate local models through native harnesses with verified compatibility #376. Create/link a narrowly scoped upstream issue only for that evidenced blocker; do not pre-create speculative issues in engine vendors' repos.

Acceptance criteria

  • AC1: at least one exact combination for every runtime advertised as supported completes the native coding fixture. Missing hardware remains a named unverified gate, not a fabricated pass.
  • AC2: a chat-only API, embedding model and missing-tool model are classified accurately and cannot masquerade as coding-ready.
  • AC3: arbitrary custom model IDs work without code edits when the endpoint/tool contract passes.
  • AC4: no new coding SDK, inference protocol bridge, engine-specific tool dispatcher or heavyweight provider abstraction is introduced.
  • AC5: template/parser/context/model/runtime/CLI changes make previous evidence visibly stale; the published matrix includes observed limits and setup requirements.

Verification and handoff

Use deterministic fake-runtime/native-CLI fixtures for PR CI; keep large model downloads/GPU requirements out of default tests. Separately run authorized native qualification on preinstalled runtimes/models. Run focused compatibility tests, pnpm build && pnpm test, and UI pnpm test:e2e when changed. Record exact SHA, commands, versions, real tool outcomes, failures/skips and locality limits. Update status and dated evidence; no merge/release.

Long-running goal prompt

Implement LM-6 in TypeSafeAI/modex under #376 after consuming #378/#379/#380's accepted artifacts. Read current AGENTS.md, actual source and open PRs; verify main and an owned worktree. Qualify servers against the existing native contract. Add the smallest metadata presets for llama.cpp/vLLM and preserve the generic Responses/manual-ID path. Test real tool/history/Stop behavior rather than inferring support from API branding. Record exact model/template/parser/context/runtime/CLI evidence and invalidate stale qualification. Do not answer protocol gaps by building a new executor/proxy or weakening policy. Use failing-first tests, run targeted/full checks and prepare signed reviewable commits with status/evidence. Checkpoint SHAs, results, remaining hardware/native gates and one next action. No merge, release, global config rewrites or unapproved downloads.

Follow-up / resume prompt

Resume LM-6 from current issue/PR and checkpoint. Verify worktree ownership, actual diff and prerequisite contracts. Refresh the exact runtime/model/template/parser/context/CLI matrix and invalidate stale results. Reproduce the highest-impact failing combination with a bounded fixture; record unsupported semantics precisely. Preserve working shared execution instead of adding speculative adapters for untested engines. A new upstream issue needs a concrete owner/version/reproducer and tracker link. Rerun smoke/full checks, distinguish fixtures from native hardware evidence and leave missing gates open with a next action. No merge, publication or scope expansion.

Activity

  1. self-assigned this
    on Oct 23, 2026
  2. BunsDev commented on Oct 23, 2026

    @BunsDev
    ContributorAuthor

    Refreshed goal prompts — 2026-10-23 (main at 203a350)

    On main already:

    Still open:

    Local worktrees lm1-contract, lm2-discovery, lm3-isolation and lm-foundation are claimed by other sessions. Don't adopt or edit them.

    Long-running goal prompt

    Implement LM-6 (#382) in TypeSafeAI/modex under tracker #376. Read AGENTS.md, #376's shared execution contract, #377–#380, draft PR #386, docs/status.md and docs/local-models.md once it lands, including LM-1's native receipt; then verify main's SHA. Create your own worktree with scripts/worktree.sh new and check; never edit the primary checkout or another session's worktree. Gate: start only after #378, #379 and #380 have landed and been accepted; this is Gate C, not the Ollama/LM Studio pilot. Coding turns run only through codex app-server; add no SDK, protocol proxy, translation layer or engine-specific tool dispatcher. Slice 1: small llama.cpp and vLLM presets under apps/desktop/src/main/engine/local-models/, plus the manual Custom Responses option, mapped explicitly onto #386's discovery kinds. Slice 2: deterministic fake-runtime and fake-CLI fixtures in apps/desktop/test/local-model-compatibility.test.ts. Cover streamed tool arguments, tool-result round trips, history continuation and Stop. A chat-only server, an embedding model and a model with no tools must never show as coding-ready, and an arbitrary model ID must qualify without code changes. Slice 3: key evidence to runtime, model revision or digest, quantization, template, tool parser, effective context and CLI version. Unknown fields stay unknown, and any change marks old results stale. Slice 4: on preinstalled runtimes only, with Val's authorization and no downloads, run the native coding fixture for each runtime you advertise. Hardware you lack stays a named unverified gate. Document server prerequisites and remedies, and never rewrite the user's server or global CLI config. A concrete upstream defect goes into #376 with owner, version and reproducer before any upstream issue. Write failing tests first. Run pnpm build && pnpm test, and pnpm test:e2e if UI changes. Update the matrix in docs/local-models.md, docs/status.md and a dated docs/reviews/ receipt. Open signed PRs and wait for Val's go-ahead to merge.
    

    Follow-up / resume prompt

    Resume LM-6 (#382). Confirm you own the worktree, fetch main, and read the latest comments here and on #376–#380. Check that the producer contracts you consume are still the accepted ones. Re-run the compatibility fixtures, then refresh the runtime/model/template/parser/context/CLI matrix and mark anything that changed as stale. Reproduce the highest-impact failing combination with a bounded fixture and record exactly what is unsupported; don't add adapters for untested engines. Record runtime and codex versions with any native run. Post a checkpoint: SHA, results, which rows are native versus fixture, what still needs hardware or Val's authorization, and one next action.
    
  3. BunsDev commented on Nov 11, 2026

    @BunsDev
    ContributorAuthor

    LM-6 native qualification checkpoint — 2026-11-11

    The instrumented native AC1 fixture completed through Modex LocalExecution → Codex 0.167.0 → the preinstalled Ollama-bundled llama-server. Tested source is candidate 7d2d6c89de5a262d08876777a907568acd4a4405, tree 2bd27e068003bc7306645f56dab368ab66399594; protected delivery is pending in #498.

    The bundled server reports 0.9.0-dev, build 1, commit 6c01da627; this identifies the bundled build rather than an independently rebuilt upstream release. Its binary SHA256 is 3806b140070f86d9fb4ab6eb90bebeda995bcba313a17590d34d3332d406e951. The approved qwen3-coder:30b GGUF has SHA256 1194192cf2a187eb02722edcc3f77b11d21f537048ce04b67ccf8ba78863006a. It was served under the arbitrary ID modex-lm6-fixture/coder:30b through the existing generic Responses connection.

    The tested configuration requested all-layer offload on enumerated MTL0 (Apple M5 Max), two CPU threads, one slot and 65,536 context tokens, with offline mode and server-owned agent/UI/warmup disabled. The actual server log confirms the loaded 65,536-token slot. Offloaded layer count was not measured.

    Read completed in 4,135 ms; the following fixture-approved edit and independent check completed in 2,584 ms. Workflow total was 6,736 ms, excluding outer server startup and input hashing. Production typed observations record three unique successful shell commands across two turns: cat fixture.txt, the exact approved write to result.txt, and node check.cjs. Both exact fixture approval callbacks ran; literal fixture/result/check bytes and one recorded check effect were independently verified. These timings are one observation with uncontrolled host caches, without a comparative speedup claim.

    Model and native workers used the same identified kernel boundary; their external-TCP and outside-write probes returned EPERM. The synthetic HOME fixture retained its bytes, mtime and tree; the real Codex config.toml fingerprint remained unchanged. Before/after model-weight hashes match. Actual Codex/model child close events and owner exits/stream closures are retained. Independent review verified the original receipts, literal files, seven instrumentation-source bindings and all 855 compiled fingerprints.

    Counterevidence remains: the two-thread CPU-only profile failed after 300,118 ms waiting for SSE while the server was still prefilling, with no tools or approvals. Codex's timeout was unchanged. An earlier startup-only attempt stopped because the context-log guard omitted this build's n_ctx_slot field; that first failure and its strict parser regression are retained separately.

    This establishes one instrumented native fixture configuration. Raw Codex sessions were removed by production disposal; the evidence is typed observations plus literal effects. No raw HTTP-status count or general exactly-once guarantee is claimed. Compaction, Stop/crash/OOM recovery, normal product UI, installed/human acceptance and product admission remain open. This does not qualify vLLM, LM Studio, every llama.cpp build or arbitrary generic servers, and it does not close #382 or #383.

    Full local receipts and immutable source snapshots are retained in the campaign evidence packet. Canonical audit lm6-metal-terminal-audit.json SHA256: 4b6fe604f71e17a6e13822431f43a7e6c60915a79febd9f3f61050229721941f. A repository review draft is prepared in the evidence packet for a separate delivery after #498; checklists remain unticked where their full text is unmet.

  4. BunsDev commented on Nov 12, 2026

    @BunsDev
    ContributorAuthor

    Additional LM-6 evidence: the same bundled llama-server/approved-weight/native Codex combination from the read/edit/test receipt now has a completed instrumented Stop fixture at application head 7d2d6c89de5a262d08876777a907568acd4a4405, tree 2bd27e068003bc7306645f56dab368ab66399594. The profile remained two CPU threads, configured Metal layers all/MTL0, one slot and observed 65,536 context. No application source or product admission changed.

    The existing production LocalExecution/Codex path requested approval for exactly node delayed-write.cjs stop. The seeded script recorded its actual start and ten-second effect deadline. The fixture sent the turn's AbortSignal 13 ms after that marker; runTurn returned interrupted five milliseconds later. There was one approval, one typed native tool start and a matching interrupted tool completion, one literal command-dispatch record, and zero effect records/files through the deadline plus 1,500 ms. These timings describe one fixture, not a universal latency or cancellation guarantee.

    The test observed that deadline before disposing its execution. The later owned Codex SIGKILL was fixture cleanup, not the ordinary Stop action. Both native and model owners closed with their output streams; subsequent probes found all five recorded process IDs absent and the owned listener refused connections. The native and inference-server boundary receipts share the same kernel profile and both record external TCP and outside-write denial. Synthetic configuration bytes/mtime/tree and the personal configuration fingerprint stayed unchanged; before/after model-weight digests match. All 1,279 tracked and 855 compiled build bindings remain unchanged.

    Preexecution controls passed 19 receipt cases, two literal delayed-script cases and five controller lifecycle cases. A separate default invocation deliberately skipped the opt-in native test; the actual model run executed one test with zero failures, skips or cancellations. Independent preexecution and actual-receipt reviews found no Critical or Important findings in this scope. The inherited retained-copy limitation remains: its controller.json is a pre-finalization snapshot; the canonical external receipt and original root provide terminal state. Raw CLI session files were removed by normal owned execution disposal, so the proof is retained typed observations, literal files and process receipts.

    Canonical evidence is /Users/buns/Documents/Codex/2026-11-11/modex-closeout/lm6-stop-model-stop-first.json, with lm6-stop-native-terminal-audit.json, lm6-stop-native-terminal-independent-review.json and reviewed helper snapshots alongside it. This qualifies one instrumented production abort-path fixture. Renderer-button/human acceptance, fresh continuation/restart, server/native loss, OOM, overflow, compaction, other runtime/platform combinations, protected delivery and product admission retain their separate gates. No issue checkbox or support-matrix claim is completed by this result alone.

  5. BunsDev commented on Nov 12, 2026

    @BunsDev
    ContributorAuthor

    Additional LM-6 evidence at application head 7d2d6c89de5a262d08876777a907568acd4a4405, tree 2bd27e068003bc7306645f56dab368ab66399594: the same bundled llama-server/approved weights/Codex combination now passes a two-process native execution restart fixture. This extends the bounded Stop receipt. The same owned inference server stayed running across both phases, with the previously recorded Metal profile, one slot and observed 65,536 context.

    The first worker performed one approved delayed command, returned interrupted after explicit Stop, observed zero effects through its ten-second deadline plus 1,501 ms, disposed its native execution, and exited with its streams closed. A second Node worker constructed a new production LocalExecution using the persisted fixture target/profile. Its attempt to use the actual old native session failed with “native session is gone” before any native child, observation or approval. Only then did the fixture explicitly start a fresh turn without that handle and approve exactly node delayed-write.cjs after-stop: one new native tool start/completion, one literal fresh dispatch and one effect. The original Stop dispatch remained one with zero effects. Both stored session handles match their corresponding typed native thread IDs and are distinct; both native processes and worker processes are distinct.

    The saved Stop receipt and fixture restart state stayed byte-identical, and the connection-profile digest matches before restart, before/after the fresh phase, and final disk bytes. Both synthetic configuration checks and the personal configuration fingerprint across both phases stayed unchanged. Native/server boundary receipts share the same kernel profile with external TCP and outside-write denial; before/after weights match. All 1,279 tracked and 855 compiled build bindings remain unchanged. All three owners and their child/output streams closed; subsequent probes found all eight recorded process IDs absent and the owned listener refused connections.

    The validator's 29 synthetic controls and five controller lifecycle controls passed; coordinated session/thread mismatches were first reproduced as failures and then refused after the validator repair. Each actual native phase executed one passing test with zero failures, skips or cancellations. Independent preexecution and actual-receipt audits found no Critical or Important findings within this scope. The inherited archival limitation remains: the copied controller.json precedes finalization, while the canonical external receipt and original root contain terminal state. Normal owned disposal removes raw CLI sessions; typed observations and literal fixture/process receipts are retained.

    Canonical evidence is /Users/buns/Documents/Codex/2026-11-11/modex-closeout/lm6-restart-model-restart-first.json, with lm6-restart-native-terminal-audit.json, lm6-restart-native-terminal-independent-review.json and reviewed helper sources alongside it. Acceptance covers native execution restart, stale authority refusal and an explicit fresh action in this instrumented fixture. Electron relaunch, application transcript persistence, renderer controls, human acceptance, inference-server restart, server/native loss, OOM, overflow, compaction, other combinations, protected delivery and product admission remain separate requirements. No issue checkbox was changed.

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

Metadata

Metadata

Assignees

Labels

area:local-modelsenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions