fix(backend): wire THUNDERBOLT_INFERENCE_URL through the inference proxy - #1203
Open
njbrake wants to merge 1 commit into
Open
fix(backend): wire THUNDERBOLT_INFERENCE_URL through the inference proxy#1203njbrake wants to merge 1 commit into
njbrake wants to merge 1 commit into
Conversation
_Note: this PR description was drafted by Claude via back-and-forth with @njbrake. The reasoning and decisions are his; the prose is Claude's._ Makes `THUNDERBOLT_INFERENCE_URL` work. It is documented in `docs/self-hosting/configuration.md` as the way to point a self-hosted backend at an OpenAI-compatible gateway, but nothing read it: the variable was absent from `settings.ts` and from the inference client, so setting it had no effect. Adds the setting, a `thunderbolt-inference` provider in the inference client, and routing in `inference/routes.ts` for model ids the built-in table does not cover. Models are **discovered** from the endpoint's `GET /models` rather than listed by hand, so a gateway that gains a model needs no redeploy. Discovery is cached for five minutes and refreshed when the app fetches `/config`. If the endpoint is unreachable its models are omitted and the built-ins keep working, so a gateway outage cannot break boot. `THUNDERBOLT_INFERENCE_MODELS` stays optional and now does two things when set: restricts which discovered models are exposed, and supplies display names. Requests are proxied through the backend, so the gateway key stays server side and the gateway needs no CORS configuration. Capabilities are advertised conservatively because the endpoint cannot be introspected. Verified against a live gateway: 16 discovered models, and server logs confirming `provider="thunderbolt-inference"` with a 200 on a real completion. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Preview environment deployed 🚀
Stack: Auto-destroys on PR close/merge. Login via the bundled Keycloak realm — |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: this PR description was drafted by Claude via back-and-forth with @njbrake. The reasoning and decisions are his; the prose is Claude's.
Makes
THUNDERBOLT_INFERENCE_URLwork. It is documented indocs/self-hosting/configuration.mdas the way to point a self-hosted backend at an OpenAI-compatible gateway, but nothing read it: the variable was absent fromsettings.tsand from the inference client, so setting it had no effect.Adds the setting, a
thunderbolt-inferenceprovider in the inference client, and routing ininference/routes.tsfor model ids the built-in table does not cover.Models are discovered from the endpoint's
GET /modelsrather than listed by hand, so a gateway that gains a model needs no redeploy. Discovery is cached for five minutes and refreshed when the app fetches/config. If the endpoint is unreachable its models are omitted and the built-ins keep working, so a gateway outage cannot break boot.THUNDERBOLT_INFERENCE_MODELSstays optional and now does two things when set: restricts which discovered models are exposed, and supplies display names.Requests are proxied through the backend, so the gateway key stays server side and the gateway needs no CORS configuration. Capabilities are advertised conservatively because the endpoint cannot be introspected.
Verified against a live gateway: 16 discovered models, and server logs confirming
provider="thunderbolt-inference"with a 200 on a real completion.