feat(api): add support for custom API base URL in configuration#152
feat(api): add support for custom API base URL in configuration#152mohammadmaso wants to merge 1 commit into
Conversation
- Introduced `resolve_api_base` function to extract the `api_base` key from the configuration, ensuring it is a valid URL string. - Updated `_setup_llm_key` to utilize the custom API base URL, falling back to the `LLM_API_BASE` environment variable if not set in the config. - Enhanced LLM call functions to include the API base in request parameters. - Modified `build_query_agent` to pass the API base as part of extra arguments. This change allows users to configure a custom API endpoint for LLM requests, improving flexibility and integration with different environments.
|
Thanks for the PR! I think a custom # .openkb/config.yaml
litellm:
api_base: https://your-endpoint/v1That routes both the compile path ( Could you give that a try and see whether it already covers your use case? If it does, we may not need the extra plumbing; and if there's a path it doesn't reach, that'd be useful to know so we can scope the change to just that gap. |
resolve_api_basefunction to extract theapi_basekey from the configuration, ensuring it is a valid URL string._setup_llm_keyto utilize the custom API base URL, falling back to theLLM_API_BASEenvironment variable if not set in the config.build_query_agentto pass the API base as part of extra arguments.This change allows users to configure a custom API endpoint for LLM requests, improving flexibility and integration with different environments.