Skip to content

feat: add LiteLLM as AI gateway provider#2193

Open
RheagalFire wants to merge 2 commits into
netease-youdao:mainfrom
RheagalFire:feat/add-litellm-provider
Open

feat: add LiteLLM as AI gateway provider#2193
RheagalFire wants to merge 2 commits into
netease-youdao:mainfrom
RheagalFire:feat/add-litellm-provider

Conversation

@RheagalFire

Copy link
Copy Markdown

Summary

Add LiteLLM as an AI gateway provider. Users point the base URL at a LiteLLM proxy to access 100+ LLM providers through one OpenAI-compatible endpoint. No new dependencies - reuses existing chatWithOpenAICompatible handler.

Related Issue

N/A

Changes Made

  • src/shared/providers/constants.ts - Added LiteLLM to ProviderName, OpenClawProviderId, and PROVIDER_DEFINITIONS
  • src/main/libs/openclawConfigSync.ts - Added LiteLLM descriptor to PROVIDER_REGISTRY
  • src/renderer/components/icons/providers/LiteLLMIcon.tsx - New icon component
  • src/renderer/components/icons/providers/index.ts - Export new icon
  • src/renderer/providers/uiRegistry.tsx - Register icon in provider icon map
  • src/shared/providers/constants.test.ts - Added dedicated LiteLLM test + updated count assertions

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation update
  • Performance improvement
  • Other (please describe):

Testing

  • Tested locally
  • Added new tests
  • Updated existing tests
  • Manual testing performed

Screenshots (if applicable)

N/A

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Electron-Specific Changes

  • Changes to main process (src/main/)
  • Changes to preload script (src/main/preload.ts)
  • Changes to IPC communication
  • Changes to window management
  • None

Additional Notes

  • Additive only, no existing providers modified
  • No new dependencies
  • Default model list is empty, users add models matching their proxy config
  • Live E2E verified: LiteLLM proxy (localhost:4000) -> Claude via Azure Foundry -> response parsed correctly

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 感谢你提交第一个 Pull Request!欢迎参与 LobsterAI 社区。

请确认 PR 已满足以下要求:

  • 遵循 Conventional Commits 规范
  • 包含清晰的变更说明
  • UI 变更附上截图
  • 通过所有 CI 检查

维护者会尽快 Review,感谢你的贡献!


👋 Thanks for your first pull request to LobsterAI! We appreciate your contribution.

Please make sure your PR:

  • Follows the Conventional Commits spec
  • Includes a clear description of the changes
  • Has screenshots for UI changes
  • Passes all CI checks

A maintainer will review your PR soon. Thank you! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant