feat: add LiteLLM as an AI provider - #2757
Open
prodmanpd wants to merge 1 commit into
Open
Conversation
Contributor
|
整体 Review 结论:本次 LiteLLM Provider 的改动方向和实现逻辑没有发现阻塞问题。 从 PR 描述看,提交者已经完成:
不过,目前描述中没有看到 Java 17 环境下的完整 Community 打包、实际服务启动,以及连接真实 LiteLLM Proxy 完成模型调用的验证记录。请提交者确认是否做过上述启动和联调测试;如已完成,建议补充测试命令与结果。 我基于当前 PR HEAD(
代码 Review 方面:
剩余验证缺口是当前环境没有配置可用的真实 LiteLLM Proxy,因此未执行端到端模型请求。另请注意,默认地址 综上,本 PR 整体没有发现阻塞性问题;提交者确认实际 LiteLLM 联调情况后即可推进合并。 |
auenger
approved these changes
Aug 25, 2026
auenger
left a comment
Contributor
There was a problem hiding this comment.
Review 通过。
本次 LiteLLM Provider 的前后端类型、默认配置、客户端工厂和 OpenAI-compatible 调用链路完整,未发现阻塞性问题。已在当前 PR HEAD 上补充完成 Java 17 后端模块编译、Community 完整打包、前端专项测试和本地服务启动冒烟,结果均通过。
真实 LiteLLM Proxy 的端到端模型调用当前未执行,建议合并前由提交者确认联调结果;该项作为非阻塞验证建议。
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
Adds LiteLLM as a first class AI provider, alongside OpenAI, Claude, Gemini, and MiniMax.
LiteLLM exposes an OpenAI compatible endpoint (the self hosted LiteLLM proxy), so a single "LiteLLM" provider entry lets a user reach 100+ models across every provider LiteLLM supports (OpenAI, Anthropic, Gemini, Bedrock, Vertex, Azure, Groq, Mistral, DeepSeek, local models, and more) through one configuration, without needing a Vertex or GCP project for Gemini or a separate entry per vendor.
Because the LiteLLM proxy speaks the OpenAI protocol, the provider reuses the existing
OpenAiChatModelclient pointed at the user's configured base URL.Affected surfaces
Verification
mvn -pl chat2db-community-web -am compilegives BUILD SUCCESS (0 errors;AiProviderEnum,AiModelFactory,AiModelConfigServiceImplall compiled).tsx src/blocks/AI/components/AIModelConfigModal/modelConfigDefaults.test.tsprintsAI model config default tests passed.(extended with the LiteLLM base URL default and provider switch cases).LITELLMroutes throughAiModelFactory.openAiClient(...)(the OpenAI compatible path). Wire compatibility is the standard LiteLLM proxy OpenAI endpoint (POST <baseUrl>/v1/chat/completions), which is the same endpoint the existing OpenAI provider already targets and the repo already ships and tests.{ label: 'LiteLLM', value: 'LITELLM' }to the provider dropdown and the api key required rule; no layout change (reuses the existing base URL and API key fields). Screenshot can be added on request.Risk and compatibility
Reviewer map
AiModelFactory.java(theLITELLMtoopenAiClientbranch) andAiModelConfigServiceImpl.java(test, normalize, env fallback, and validate branches).LITELLMconfig with no reachablebase_urlfails exactly like an OpenAI config with a bad base URL (surfaced by the existing connection test).LITELLMenum value and its branches; no data migration needed.Contributor declaration
AI assistance: This provider integration was implemented with AI assisted coding and reviewed before submission.