M04: Generic OpenAI-compatible HTTP adapter and Ollama integration #89
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#95 M10: Distribution, installation, update, and end-to-end acceptance
Creatidy/scarcity-router
#85 A0: Architecture, decisions, and contracts for the optional execution gateway
Creatidy/scarcity-router
#88 M03: OpenAI-compatible gateway and execution coordinator
Creatidy/scarcity-router
Reference
Creatidy/scarcity-router#89
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Support configurable OpenAI-compatible APIs and local inference through ONE generic HTTP adapter with explicit provider-specific differences — not a separate gateway per provider.
Module of the execution-gateway program; architecture and contracts come from A0 (#85).
User value
Users bring their existing OpenAI, DeepSeek, OpenRouter and Z.ai API keys, plus their local Ollama, and everything appears as routable resources with PAYG and entitlement channels kept distinct.
Relationship to current code
docs/providers.md): provider differences at the adapter edge, core stays provider-independent.Scope
Non-goals
Contracts / interfaces affected
Execution adapter contract (A0); resource registry entries (M01); compatibility matrix entries (M03).
Dependencies
Acceptance criteria
Security considerations
Outbound provider HTTP: verified TLS (no
verify=false), provider credentials bound to configured origins, SSRF protection, noAuthorizationforwarding across unsafe redirects (reject cross-origin redirects), and explicit bounded exceptions for plain-HTTP localhost only where justified (e.g. Ollama loopback). Credentials are never logged and never sourced from client request content.Risks
Evidence still required
Scope clarification after the M07 closeout (owner decision D-047, 2026-09-20; M07 Stage 1 complete, Stage 2 cancelled — see #92). No change to this issue's scope; provenance notes for the implementing agent:
https://api.z.ai/api/coding/paas/v4— re-verify with date and version at implementation time; terms suitability tracked under U-009). It flows through the ONE generic adapter with the existing preset discipline (docs/providers.md); no Z.ai-specific duplicated gateway architecture is wanted or needed.docs/zcode-adapter-stage1-evidence.md) found no official supported programmatic surface, and the owner cancelled M07 Stage 2 (D-047). Nothing in this issue wraps or shells out to the ZCode desktop runtime.Closeout (v0.1.0 release-readiness reconciliation, 2026-09-21). M04 is implemented and its acceptance criteria are satisfied on
develop@9d6192e.providers/openai_http_adapter.py+openai_http_core.py, 50+50 tests) with evidence-backed presets (providers/openai_http_evidence.py) and the shared translation core; Ollama is served through the same core direct (server-direct HTTP) and worker-bridged (worker_local_translation.py— one inference implementation, two transports, no second Ollama implementation).tests/test_e2e_acceptance.pyscenarios); a localhost-only Ollama behind the worker is covered by the worker-bridged e2e scenarios (M10); the compatibility matrix reflects real, dated evidence — providers are not labeled fully OpenAI-compatible where features differ,genericstays all-UNKNOWNand fails closed; no automatic model downloads/GPU management anywhere.server_composition(M04default_cells_forper bound preset resource), so un-evidenced presets still fail closed withcompatibility_unknown.test_redirects_are_refused_and_never_followed), plain HTTP only for explicit loopback origins, no credential from client request content — pinned intests/test_openai_http_adapter.pyand the M10 security matrix.make check1868 tests OK, basedpyright clean,make package-checkgreen; Forgejo CI green ondevelop(run #25).Closing as complete;
docs/roadmap.mdnow records M04 complete.