Skip to content

Commit 550c3cb

Browse files
author
Aditya Puranik
committed
feat(copilot): add LiteLLM model support
1 parent 0ac8f33 commit 550c3cb

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

apps/sim/app/api/copilot/chat/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const ChatMessageSchema = z.object({
6464
'claude-4.5-opus',
6565
'claude-4.1-opus',
6666
'gemini-3-pro',
67+
'litellm',
6768
])
6869
.optional()
6970
.default('claude-4.5-opus'),

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ export const MODEL_OPTIONS = [
241241
{ value: 'gpt-5.2-codex', label: 'GPT 5.2 Codex' },
242242
{ value: 'gpt-5.2-pro', label: 'GPT 5.2 Pro' },
243243
{ value: 'gemini-3-pro', label: 'Gemini 3 Pro' },
244+
{ value: 'litellm', label: 'LiteLLM' },
244245
] as const
245246

246247
/**

apps/sim/components/icons.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3683,14 +3683,9 @@ export function LiteLLMIcon(props: SVGProps<SVGSVGElement>) {
36833683
return (
36843684
<svg {...props} viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'>
36853685
<title>LiteLLM</title>
3686-
<path
3687-
d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'
3688-
stroke='#10B981'
3689-
strokeWidth='2'
3690-
strokeLinecap='round'
3691-
strokeLinejoin='round'
3692-
fill='none'
3693-
/>
3686+
<text x='12' y='17' fontSize='16' textAnchor='middle' dominantBaseline='middle'>
3687+
🚅
3688+
</text>
36943689
</svg>
36953690
)
36963691
}

apps/sim/lib/copilot/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export interface SendMessageRequest {
8989
| 'claude-4.5-opus'
9090
| 'claude-4.1-opus'
9191
| 'gemini-3-pro'
92+
| 'litellm'
9293
prefetch?: boolean
9394
createNewChat?: boolean
9495
stream?: boolean

apps/sim/lib/copilot/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const VALID_PROVIDER_IDS: readonly ProviderId[] = [
1919
'mistral',
2020
'groq',
2121
'ollama',
22+
'litellm',
2223
] as const
2324

2425
/**

apps/sim/providers/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ export function getProviderFromModel(model: string): ProviderId {
170170

171171
let providerId: ProviderId | null = null
172172

173-
if (normalizedModel in getAllModelProviders()) {
173+
// Check if the model is actually a provider ID (e.g., "litellm" from copilot selector)
174+
if (normalizedModel in providers) {
175+
providerId = normalizedModel as ProviderId
176+
} else if (normalizedModel in getAllModelProviders()) {
174177
providerId = getAllModelProviders()[normalizedModel]
175178
} else {
176179
for (const [id, config] of Object.entries(providers)) {

apps/sim/stores/panel/copilot/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export interface CopilotState {
118118
| 'claude-4.5-opus'
119119
| 'claude-4.1-opus'
120120
| 'gemini-3-pro'
121+
| 'litellm'
121122
agentPrefetch: boolean
122123
enabledModels: string[] | null // Null means not loaded yet, array of model IDs when loaded
123124
isCollapsed: boolean

0 commit comments

Comments
 (0)