Skip to content

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

fix(playground): allow for creation of non-openai llm api keys (#3162)

Marc Klingen7ed03a094639
diff --git a/web/src/components/ModelParameters/LLMApiKeyComponent.tsx b/web/src/components/ModelParameters/LLMApiKeyComponent.tsx
index f5f220eba6..3429cce3ad 100644
--- a/web/src/components/ModelParameters/LLMApiKeyComponent.tsx
+++ b/web/src/components/ModelParameters/LLMApiKeyComponent.tsx
@@ -47,7 +47,7 @@ export const LLMApiKeyComponent = (p: {
<Label className="text-xs font-semibold">API key</Label>
<div>
{apiKey ? (
- <Link href={`/project/${p.projectId}/settings#llm-api-keys`}>
+ <Link href={`/project/${p.projectId}/settings/api-keys`}>
<span className="mr-2 rounded-sm bg-input p-1 text-xs">
{apiKey.displaySecretKey}
</span>
diff --git a/web/src/components/ModelParameters/index.tsx b/web/src/components/ModelParameters/index.tsx
index a19205bc2b..bf7d43ac4b 100644
--- a/web/src/components/ModelParameters/index.tsx
+++ b/web/src/components/ModelParameters/index.tsx
@@ -31,12 +31,15 @@ export type ModelParamsContext = {
formDisabled?: boolean;
};
-export const ModelParameters: React.FC<ModelParamsContext> = ({
+export const ModelParameters: React.FC<
+ ModelParamsContext & { evalModelsOnly: boolean }
+> = ({
modelParams,
availableProviders,
availableModels,
updateModelParamValue,
setModelParamEnabled,
+ evalModelsOnly,
formDisabled = false,
}) => {
const projectId = useProjectIdFromURL();
@@ -49,10 +52,10 @@ export const ModelParameters: React.FC<ModelParamsContext> = ({
{availableProviders.length === 0 ? (
<>
<p className="text-xs">
- No LLM API key set in project. For evals, we only support OpenAI so
- far.
+ No LLM API key set in project.{" "}
+ {evalModelsOnly && "For evals, only OpenAI models are supported."}
</p>
- <CreateLLMApiKeyDialog evalModelsOnly={true} />
+ <CreateLLMApiKeyDialog evalModelsOnly={evalModelsOnly} />
</>
) : (
<div className="space-y-4">
diff --git a/web/src/ee/features/evals/components/template-form.tsx b/web/src/ee/features/evals/components/template-form.tsx
index f07a870748..90d6e0fede 100644
--- a/web/src/ee/features/evals/components/template-form.tsx
+++ b/web/src/ee/features/evals/components/template-form.tsx
@@ -427,6 +427,7 @@ export const InnerEvalTemplateForm = (props: {
updateModelParamValue: updateModelParamValue,
setModelParamEnabled,
}}
+ evalModelsOnly
formDisabled={!props.isEditing}
/>
</div>
diff --git a/web/src/ee/features/playground/page/playground.tsx b/web/src/ee/features/playground/page/playground.tsx
index 09ec7e1067..05ebafff92 100644
--- a/web/src/ee/features/playground/page/playground.tsx
+++ b/web/src/ee/features/playground/page/playground.tsx
@@ -13,8 +13,8 @@ export default function Playground() {
</div>
<div className="h-full basis-1/4 pr-2">
<div className="flex h-full flex-col">
- <div className="basis-[55%] ">
- <ModelParameters {...playgroundContext} />
+ <div className="basis-[55%]">
+ <ModelParameters {...playgroundContext} evalModelsOnly={false} />
</div>
<div className="mt-4 basis-[45%] overflow-auto">
<Variables />