Skip to content

[AI-214] Use several inference providers at the same time - #10

Closed
xhr15 wants to merge 7 commits into
implementation/ai-213-point-semantic-indexes-and-feature-bindings-at-stored-modelsfrom
implementation/ai-214-use-several-inference-providers-at-the-same-time
Closed

xhr15 wants to merge 7 commits into
implementation/ai-213-point-semantic-indexes-and-feature-bindings-at-stored-modelsfrom
implementation/ai-214-use-several-inference-providers-at-the-same-time

Conversation

@xhr15

@xhr15 xhr15 commented Nov 4, 2026

Copy link
Copy Markdown
Member

Ticket

https://community.openproject.org/wp/AI-214

Stacked on AI-213, so the diff only shows this ticket.

What are you trying to accomplish?

All inference providers can be used at the same time. No provider is active and activating is gone: each model belongs to its provider, and a feature reaches a server through the model it uses.

  • Providers: server settings, model lists, capability verdicts and health reports belong to a provider. One LlmConnection row stays for the default models, the feature bindings and what the environment provisioned.
  • First provider: while none exists, the settings page is the one form that checks the server, then saves the provider and the switch.
  • Provider list: after that, the page shows the switch above a table of providers, and further providers are added through a dialog. Each row can be edited, have its API key removed and be deleted.
  • Deleting: a provider can't be deleted while a semantic index, a default model or a feature binding uses one of its models, and the dialog names each of them. Deleting the last provider returns the page to the first form.
  • Health: each provider has its own report, and the six-hour job runs per provider. Each row shows the latest result and links to the report. "Run health check" runs in the background, and every fetch of a model list ends with the same check. Meanwhile the row says "Checking models…" or "Running checks…".
  • Embedding-only providers: a manual check sends them one short embedding request, since they have no chat model to test.
  • Models tab: a select switches between the providers' model lists.
  • Semantic indexes: the list names each index's provider next to its model.

Until AI-215, model selects list every model as "model @ provider".

Screenshots

What approach did you choose and why?

  • Model lists refresh only by hand: a new provider's list is fetched once in the background, so the fingerprint and the stale warning are gone.
  • Unique titles: they are how providers are told apart. A blank title becomes the host and port, with a number added if that's taken.
  • Changing the API format checks the server again: otherwise a wrong choice would mean deleting the provider.
  • Health checks run as a job: the full check includes the billed completion. Leaving the page doesn't lose it, and a slow provider can't run into the request timeout. The report page's "Run checks" still runs inside the request.
  • Status read from GoodJob: the row's status comes from the jobs' concurrency keys rather than stored state, so a worker that dies leaves nothing stale behind. The list polls, and the server only answers with a new list once a row would change, so an open row menu stays open.
  • A check after every fetch: an administrator who only looks at the provider list still learns how a provider is doing. "Refresh models" therefore spends one completion per click.
  • The embedding request stays manual: hosted providers bill it, so the six-hourly job doesn't send it.

The commits are meant to be reviewed one by one.

AI involvement

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

xhr15 added 7 commits November 4, 2026 08:27
The single LlmConnection held the server settings and the model list,
so only one server could be in use. Server settings, model lists,
verdicts and health reports now belong to an inference provider, and a
feature reaches a server through the model row it uses. No provider is
active: all of them can be used at once, and activating is gone.

One LlmConnection row stays for the default models, the feature bindings
and what the environment provisioned, reached through
LlmConnection.current. LlmConnection.available? now asks whether the
switch is on and a provider exists.

While no provider exists, the settings page is still the one form that
checks the server first and then saves the provider and the switch. A
new provider's model list is fetched once in the background, and after
that only by hand, so the fingerprint and the stale warning are gone.
Model pickers list every provider's models as "model @ provider" for
now.

A provider's health report covers its configuration, its server and its
model list, plus only the defaults, features and index that use its
models. The six-hour job runs per provider. The option naming the server
type is renamed to the spelling the checks accept, as it moved anyway.

Providers can only be added on the blank page for now, and the report
page has no link yet, until the next commits add the provider table.
With several providers the model name alone doesn't say which server an
index embeds with, so the list of semantic indexes on the feature
configuration page names the provider next to the model.
Once a provider exists, the settings page shows the switch above a table
of providers, and further providers are added through a dialog. Each
row can be edited, have its API key removed and be deleted.

Titles have to be unique, because they are how providers are told apart
from now on. A blank title becomes the host and port, with a number
added if that is taken. The API format can be changed with a new check
of the server, since a wrong choice would otherwise mean deleting the
provider. The list stays until it is refreshed by hand.

A provider can't be deleted while a semantic index, a default model or a
feature binding uses one of its models, and the dialog names each of
them with its model. Deleting removes its list, verdicts and health
reports, and deleting the last one returns the page to the first form.

The first tab is now called inference providers, and the texts that
still spoke of one connection speak of providers instead.
A provider that only serves embedding models has no chat model to test,
so it used to warn on every run and its inference was never exercised.
A manual check now sends it one short embedding request instead, which
stays out of the scheduled job because hosted providers bill it.
Each row can run its provider's health check. It runs in the background
as Llm::CheckProviderHealthJob, the full check including the billed
completion, so leaving the page doesn't lose it and a slow provider
can't run into the request timeout. Until its outcome is in, the row
says "Running checks…". That is read from GoodJob by the job's
concurrency key rather than stored, so a worker that dies leaves
nothing stale behind.

The list polls while a check runs, and the server answers with a new
list only once a row would change, so an open row menu is not closed
every two seconds.

The row shows a label summing up the latest report next to the time it
ran, which links to the report, so a server the scheduled check found
broken is visible without opening anything. The time is always shown
on a 24-hour clock.

The report page's "Run checks" still runs inside the request, and the
six-hourly check does not show on the rows.
An administrator who only looks at the provider list should still learn
how a provider is doing. Every fetch of its model list now ends with the
full health check: after capability detection when the fetch worked,
since the check picks its chat model from what detection found, and
straight away when it failed. "Refresh models" therefore spends one
completion per click.

While the fetch or the detection is queued or running, the provider's
row says "Checking models…". After saving a new provider, its row shows
"Checking models…", then "Running checks…", then the result. A fetch
waiting hours for its next attempt does not count: the check that
followed its failure already says what went wrong.
A select above the list switches between the inference providers and
opens on the first one by title. Adding a model, refreshing, filtering
and paging all stay on the chosen provider, and saving a model or the
default models returns to it.

A list that is still empty after a provider was added says that it is
fetched in the background, because a fetch that is still running and
one that failed look the same from here.
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

@xhr15 xhr15 closed this Nov 25, 2026
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.

1 participant