feat(custom-openai): add support for custom OpenAI-compatible API endpoints#7
Merged
Merged
Conversation
Collaborator
Contributor
Author
|
@debba that's probably fine just go ahead if something breaks I'll fix it later |
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.

This pull request adds support for configuring and using custom OpenAI-compatible API endpoints ("custom-openai") throughout the application. It introduces new settings for specifying a custom endpoint URL and model, updates the backend to fetch models and generate responses using the custom provider, and enhances the UI and localization to support these new options.
Backend support for custom OpenAI-compatible providers:
fetch_custom_openai_modelsand integrated it into the model-fetching logic, allowing the app to dynamically retrieve available models from a user-specified OpenAI-compatible endpoint (ai_custom_openai_url) using a custom API key. [1] [2] [3]generate_custom_openaifor sending chat completion requests to the custom endpoint, and updated the AI query and explain logic to support the "custom-openai" provider, including error handling for missing configuration. [1] [2] [3]AppConfig) and config management to persist and retrieve the custom endpoint URL and model, and to recognize a new environment variable for the custom API key. [1] [2] [3]Frontend settings and context updates:
SettingsContextand default settings to includeaiCustomOpenaiUrlandaiCustomOpenaiModel, and added "custom-openai" as a valid AI provider. [1] [2] [3]Internationalization and UI improvements:
These changes collectively enable users to connect the application to any OpenAI-compatible API (such as Groq, local servers, etc.) by specifying their own endpoint and model, greatly increasing flexibility for advanced and enterprise use cases.