Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(llm-connections): validate provider names cannot contain colons (#10782)

Michael Fröhlichff7c9e189bc2
diff --git a/web/src/features/llm-api-key/types.ts b/web/src/features/llm-api-key/types.ts
index 7fcc410ab1..b0d326f848 100644
--- a/web/src/features/llm-api-key/types.ts
+++ b/web/src/features/llm-api-key/types.ts
@@ -7,7 +7,10 @@ import {
export const LlmApiKeySchema = z.object({
projectId: z.string(),
- provider: z.string().min(1),
+ provider: z
+ .string()
+ .min(1)
+ .regex(/^[^:]+$/, "Provider name cannot contain colons"),
adapter: z.enum(LLMAdapter),
baseURL: z.string().url().optional(),
withDefaultModels: z.boolean().optional(),
diff --git a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
index 04753627d5..20de26ab71 100644
--- a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
+++ b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
@@ -49,7 +49,11 @@ const createFormSchema = (mode: "create" | "update") =>
secretKey: z.string().optional(),
provider: z
.string()
- .min(1, "Please add a provider name that identifies this connection."),
+ .min(1, "Please add a provider name that identifies this connection.")
+ .regex(
+ /^[^:]+$/,
+ "Provider name cannot contain colons. Use a format like 'OpenRouter_Mistral' instead.",
+ ),
adapter: z.nativeEnum(LLMAdapter),
baseURL: z.union([z.literal(""), z.url()]),
withDefaultModels: z.boolean(),
@@ -561,7 +565,8 @@ export function CreateLLMApiKeyForm({
<FormItem>
<FormLabel>Provider name</FormLabel>
<FormDescription>
- Key to identify the connection within Langfuse.
+ Key to identify the connection within Langfuse. Cannot contain
+ colons.
</FormDescription>
<FormControl>
<Input