Skip to content

Commit

Permalink
fix: allow litellm completion kwargs to work in the FE (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashankar authored Jan 22, 2025
1 parent 05c4357 commit 70aa7d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions website/src/app/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ export function generatePipelineConfig(
return null;
}

// Get litellm_completion_kwargs and parse it as a dictionary
const litellm_completion_kwargs =
op.otherKwargs?.litellm_completion_kwargs;
if (litellm_completion_kwargs) {
op.otherKwargs.litellm_completion_kwargs = JSON.parse(
litellm_completion_kwargs
);
}

const newOp: Record<string, unknown> = {
...op,
...op.otherKwargs,
Expand Down
11 changes: 11 additions & 0 deletions website/src/components/OperationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,17 @@ const SettingsModal: React.FC<SettingsModalProps> = React.memo(
<DialogTitle>{opName}</DialogTitle>
<DialogDescription>
Add or modify additional arguments for this {opType} operation.
For example, to set LiteLLM completion arguments, use
litellm_completion_kwargs as the key and {`{"temperature": 0}`} as
the value. See{" "}
<a
href="https://docs.litellm.ai/docs/completion/input"
target="_blank"
className="underline text-blue-500"
>
LiteLLM completion arguments
</a>{" "}
for all available options.
</DialogDescription>
</DialogHeader>
<div className="grid gap-4 py-4">
Expand Down

0 comments on commit 70aa7d0

Please sign in to comment.