[GH-ISSUE #3111] [FEAT]: Allow Customization of Base URL for OpenAI-Compatible LLM Models #1995

Closed
opened 2026-02-22 18:27:38 -05:00 by yindo · 2 comments
Owner

Originally created by @CaoMeiYouRen on GitHub (Feb 4, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3111

What would you like to see?

Issue Title: Allow Customization of Base URL for OpenAI-Compatible LLM Models

Description:
Currently, when configuring an OpenAI-compatible LLM model (e.g., local/self-hosted models or third-party services that mimic the OpenAI API), the base URL is hardcoded to OpenAI's default endpoint. This limits flexibility for users who want to integrate models hosted on alternative URLs, such as local instances (e.g., Ollama, LocalAI),custom cloud deployments, or other OpenAI-compatible API providers.

Suggested Solution:
Add an optional Base URL field in the LLM configuration settings for OpenAI-compatible models. This field would allow users to override the default base URL (e.g., https://api.openai.com/v1) with a custom endpoint (e.g., http://localhost:11434/v1).

Example Implementation:

In the model configuration UI, include a text input labeled "Custom Base URL" (optional).

If the field is left empty, fall back to the default OpenAI URL.

Ensure the configured base URL is properly validated and used for all API requests to the model.

Why This Matters:

Enables integration with self-hosted or niche OpenAI-compatible models.

Supports local development/testing (e.g., using localhost endpoints).

Increases compatibility with emerging LLM API providers that adopt the OpenAI schema.

Additional Context:
Many developers and organizations now leverage OpenAI-compatible APIs for cost, privacy, or customization reasons. Allowing base URL customization would align Anything-LLM with tools like LiteLLM or LangChain, which prioritize interoperability.

Thank you for considering this feature! 🙌

Originally created by @CaoMeiYouRen on GitHub (Feb 4, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3111 ### What would you like to see? Issue Title: Allow Customization of Base URL for OpenAI-Compatible LLM Models  Description: Currently, when configuring an OpenAI-compatible LLM model (e.g., local/self-hosted models or third-party services that mimic the OpenAI API), the base URL is hardcoded to OpenAI's default endpoint. This limits flexibility for users who want to integrate models hosted on alternative URLs, such as local instances (e.g., Ollama, LocalAI),custom cloud deployments, or other OpenAI-compatible API providers.  Suggested Solution: Add an optional Base URL field in the LLM configuration settings for OpenAI-compatible models. This field would allow users to override the default base URL (e.g., https://api.openai.com/v1) with a custom endpoint (e.g., http://localhost:11434/v1).  Example Implementation:  In the model configuration UI, include a text input labeled "Custom Base URL" (optional).  If the field is left empty, fall back to the default OpenAI URL.  Ensure the configured base URL is properly validated and used for all API requests to the model.  Why This Matters:  Enables integration with self-hosted or niche OpenAI-compatible models.  Supports local development/testing (e.g., using localhost endpoints).  Increases compatibility with emerging LLM API providers that adopt the OpenAI schema.  Additional Context: Many developers and organizations now leverage OpenAI-compatible APIs for cost, privacy, or customization reasons. Allowing base URL customization would align Anything-LLM with tools like LiteLLM or LangChain, which prioritize interoperability.  Thank you for considering this feature! 🙌
yindo added the enhancementfeature request labels 2026-02-22 18:27:38 -05:00
yindo closed this issue 2026-02-22 18:27:38 -05:00
Author
Owner

@timothycarambat commented on GitHub (Feb 4, 2025):

The Generic OpenAI LLM provider exists for this use case

Image
@timothycarambat commented on GitHub (Feb 4, 2025): The Generic OpenAI LLM provider exists for this use case <img width="1612" alt="Image" src="https://github.com/user-attachments/assets/caeb51ec-bf6e-48e8-aeb3-0c44b082aff0" />
Author
Owner

@mpetruc commented on GitHub (May 10, 2025):

is there a way to add more than one Generic OpenAI LLM provider?

@mpetruc commented on GitHub (May 10, 2025): is there a way to add more than one Generic OpenAI LLM provider?
yindo changed title from [FEAT]: Allow Customization of Base URL for OpenAI-Compatible LLM Models to [GH-ISSUE #3111] [FEAT]: Allow Customization of Base URL for OpenAI-Compatible LLM Models 2026-06-05 14:43:53 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1995