Repository navigation
[AI-214] Use several inference providers at the same time - #10
Closed
Conversation
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.
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
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.
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.
LlmConnectionrow stays for the default models, the feature bindings and what the environment provisioned.Until AI-215, model selects list every model as "model @ provider".
Screenshots
What approach did you choose and why?
The commits are meant to be reviewed one by one.
AI involvement
Merge checklist