Uh oh!
There was an error while loading. Please reload this page.
Feat/add litellm provider - #707
Merged
Merged
Conversation
3 tasks
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 freeto 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
Changes
Core (
packages/core/src/llm-connections.ts):'litellm'toProviderTypeunionPROVIDER_DEFAULTSentry: protocol'openai', category'custom', base URLhttp://localhost:4000/v1, auth'api_key', badge'Gateway''litellm'toCATALOG_PROVIDER_TYPESarrayRuntime (
packages/runtime/src/model-factory.ts):case 'litellm'ingetAIModel()usingcreateOpenAICompatible()from@ai-sdk/openai-compatiblewith name'litellm', apiKey, and baseURL fallbackUI (
apps/desktop/src/renderer/settings/):provider-brand-marks.tsx- Added'litellm'to the OpenAI brand mark caseprovider-display.tsx- Added display name "LiteLLM" with description and "Gateway" badgeUI (
packages/ui/src/chat-model-helpers.ts):litellm: 'LiteLLM'to exhaustivePROVIDER_SHORT_LABELmapTests (
packages/core/src/__tests__/llm-connections.test.ts, +26 lines):PROVIDER_DEFAULTS['litellm']correctness: label, protocol, category, baseUrl, authKind, backendKind, status, catalogBadge, empty fallbackModelspersistedBaseUrl('litellm', ...)collapses default URL toundefined, persists custom overridesTests (
packages/runtime/src/__tests__/model-factory-thinking.test.ts, +43 lines):getAIModelwith litellm: correct provider namespace'litellm.chat'and modelId, default and custom baseUrlbuildProviderOptionswith litellm: falls through to default case, returns empty{}for all thinking levelsTests
1. All 2293 tests pass (446 suites):
2. TypeScript build: clean across all 7 workspaces.
Example usage
Risk / Compatibility
@ai-sdk/openai-compatiblepackage handles everything.'openai'. Model discovery automatically uses the standard/v1/modelsendpoint.satisfies Record<ProviderType, string>compile-time check ensures the new provider is registered in every exhaustive map.