Skip to content

One self-hosted model description for Codex and Claude Code workers - #13

Merged
flujo-app merged 1 commit into
mainfrom
model-provider-workers
Nov 3, 2026
Merged

flujo-app merged 1 commit into
mainfrom
model-provider-workers

Conversation

@flujo-app

Copy link
Copy Markdown
Owner

0.4.0's plan.modelProvider was shaped around Codex. This makes it one description of a self-hosted endpoint that each worker program maps to its own settings.

  • src/model-provider.mjs:
    • validateModelProvider, with a new apis list (responses, chat, anthropic). It defaults to ['responses'], so 0.4.0 descriptions keep working.
    • providerPrograms(provider), which reports which worker programs can use an endpoint.
  • Codex mapping: codexProviderConfig (the config.toml cloud workers already used, byte-identical) and codexProviderOverrides (--config entries for local workers).
  • Claude Code mapping: claudeProviderEnvironment. It sends Claude Code to the Anthropic Messages API at the server root, with the key as a bearer token and every model alias on the served model. It sets the real context window and compaction point, turns off telemetry, update checks and error reports, and turns off the per-turn token reminder. That reminder is an extra system message that templates move to the front of the prompt, which defeats the server's prompt cache.
    • vLLM 0.32.0 serves /v1/messages; checked in its source (vllm/entrypoints/anthropic/api_router.py).
  • Local lite workers:
    • liteWorkerCommand / startLiteWorker accept modelProvider, providerKey and providerIndex for both Codex and Claude Code. The key only goes into the program's environment, never into arguments.
    • factory-lite ... --model-provider endpoint.json reads the key from the variable the file names.
  • Cloud lite workers still run Codex and refuse a provider without the Responses API. Claude Code and FLUJO as cloud worker programs are separate follow-ups.
  • Public exports and the packed-package verifier cover the new functions. PUBLIC_SDK.md is updated.

Fixes #11

Local CI (AGENTS.md)

Same steps as .github/workflows/public-sdk.yml (the focused list is read from the workflow file), on a clean git archive export of 567251b with fresh npm ci:

Platform Node / npm prod audit (high) Focused tests (23 files) Packed install + verify-public-sdk CLI help Installed MCP stdio Evidence regressions
Windows 10, portable Node 22.17.0 / 10.9.2 0 vulnerabilities 190/190 ok ok 1/1 7/7
Windows 10, portable Node 24.22.2 / 11.19.1 0 vulnerabilities 190/190 ok ok 1/1 7/7
Linux, Docker node:22.17.0-bookworm 22.17.0 / 10.9.2 0 vulnerabilities 190/190 ok ok 1/1 7/7
Linux, Docker node:24.22.2-bookworm 24.22.2 / 11.19.1 0 vulnerabilities 190/190 ok ok 1/1 7/7

No model or cloud call was made.

The provider description added in 0.4.0 was shaped around Codex. It now
lives in src/model-provider.mjs with an `apis` list (responses, chat,
anthropic) and one mapping per worker program:

- Codex: config.toml for cloud workers, --config overrides for local ones
- Claude Code: Anthropic Messages API at the server root, bearer key,
  every model alias on the served model, real context window and
  compaction point, no nonessential traffic or per-turn token reminder

Local lite workers and factory-lite accept the description and its key.
Cloud lite workers keep running Codex and refuse a provider without the
Responses API.

Fixes #11.
@flujo-app flujo-app added the enhancement New feature or request label Nov 3, 2026
@flujo-app
flujo-app merged commit 8baf85d into main Nov 3, 2026
2 checks passed
@flujo-app
flujo-app deleted the model-provider-workers branch November 3, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

One self-hosted model description for every worker program (Codex and Claude mappings)

1 participant