Skip to content

feat(api-proxy): offer two priced models instead of one - #72

Open
rickstaa wants to merge 2 commits into
mainfrom
rs/api-proxy-two-models
Open

feat(api-proxy): offer two priced models instead of one#72
rickstaa wants to merge 2 commits into
mainfrom
rs/api-proxy-two-models

Conversation

@rickstaa

@rickstaa rickstaa commented Aug 14, 2026

Copy link
Copy Markdown
Member

The api-proxy README claimed that offering a second model is "more config, not code", but the example only ever showed one. Now it shows two, served from the one nginx.

  • nginx.conf.template gets a route per capability, /sd3/proxy and /flux/proxy, each pinning its own model.
  • runners.json gets a second entry with its own app id and price, each pointing at its own path (http://app:8989/sd3), which the orchestrator preserves when it forwards. FLUX.1 schnell is faster and cheaper than SD3 medium, so the two prices differ for a reason a caller can see.
  • client.py gains --app, which is what actually demonstrates that discovery filters on app id, matched exactly.
  • The note about livepeer/api-proxy becomes a section: the static versus dynamic contrast only lands once there are two pinned capabilities to hold against runtime enablement.

One process, two registrations, because a capability is a registration and not a container. That also keeps this consistent with the ollama example, where one container serves several capabilities.

Verified offchain end to end: both register healthy, both appear in /discovery as separate capabilities, and a call through the orchestrator to each app id reserves a session and lands on the right pinned model. The upstream returns 401 on a dummy token, which is as far as this goes without an HF_TOKEN carrying inference-provider credits, so no real generation was run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SD4o2Evku53Nb6zfgAdWxV

Copilot AI lite review requested due to automatic review settings August 14, 2026 10:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 14, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

rickstaa and others added 2 commits August 17, 2026 12:14
The README claimed a second model was "more config, not code" without
showing it. Run nginx.conf.template twice with a different MODEL, give
each its own runners.json entry, app id, and price, and let the client
pick with --app. FLUX.1 schnell is cheaper than SD3 medium, so the two
prices differ for a reason a caller can see.

Each entry keeps its own capacity: the work happens upstream, so the
capabilities do not contend.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SD4o2Evku53Nb6zfgAdWxV
Two containers implied a capability is a process. It is a registration:
one nginx now carries a route per model, and each runners.json entry
points its app id at its own path, which the orchestrator preserves when
it forwards. Keeps the repo consistent with ollama, where one container
serves several capabilities.

Health stays shared. `return 200` only reported that nginx is up, never
that a model or the token is good, so a copy per capability would claim
a precision it does not have.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SD4o2Evku53Nb6zfgAdWxV
Copilot AI review requested due to automatic review settings August 17, 2026 10:14
@rickstaa
rickstaa force-pushed the rs/api-proxy-two-models branch from f3bc8a8 to 0304f5e Compare August 17, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants