[Studio] Add real LLM gateway - #651
Open
Aias00 wants to merge 14 commits into
Open
Conversation
Author
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.




Summary
code,hint,statusCode) for gateway errors and config-test failures/chat/completionsendpoints back to the provider base URL before requests are sent/modelsendpoint, with built-in fallback models when the provider is unavailableScope
Failure handling covered
llm.config.missing_api_keywith a remediation hintllm.config.invalid_api_basemaxTokensreturnsllm.config.invalid_max_tokenstemperaturereturnsllm.config.invalid_temperaturellm.config.unsupported_providerllm.provider.timeoutllm.provider.empty_responsellm.provider.malformed_responseGET {apiBase}/modelsand falls back to built-in provider models on timeout, upstream error, or malformed model responsescodefields, while retaining numeric Result envelope handlingNon-goals
Tests
447883a [Studio] Use LLM config on AI chat page8dfea98 [Studio] Load LLM models from providerJAVA_HOME=$(/usr/libexec/java_home -v 21) mvn -q -Dtest=OpenAiCompatibleLlmClientTest,LlmConfigServiceTest,OpenAiCompatibleLlmGatewayTest,LlmControllerTest,GlobalExceptionHandlerTest testJAVA_HOME=$(/usr/libexec/java_home -v 21) mvn -q testnpm test -- --run src/api/llm.test.ts src/api/client.test.ts src/pages/studio/__tests__/LlmSettings.test.tsnpm run buildnpm run lintgit diff --check