Skip to content

Commit

Permalink
Add better vertex support + LLM form cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Dec 9, 2024
1 parent 970320b commit 75a448c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion backend/danswer/llm/chat_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,16 @@ def __init__(

# NOTE: have to set these as environment variables for Litellm since
# not all are able to passed in but they always support them set as env
# variables
# variables. We'll also try passing them in, since litellm just ignores
# addtional kwargs (and some kwargs MUST be passed in rather than set as
# env variables)
if custom_config:
for k, v in custom_config.items():
os.environ[k] = v

model_kwargs = model_kwargs or {}
if custom_config:
model_kwargs.update(custom_config)
if extra_headers:
model_kwargs.update({"extra_headers": extra_headers})
if extra_body:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,9 @@ export function CustomLLMProviderUpdateForm({
<SubLabel>
<>
<div>
Additional configurations needed by the model provider. Are
passed to litellm via environment variables.
Additional configurations needed by the model provider. These
are passed to litellm via environment + as arguments into the
`completion` call.
</div>

<div className="mt-2">
Expand All @@ -290,14 +291,14 @@ export function CustomLLMProviderUpdateForm({
<FieldArray
name="custom_config_list"
render={(arrayHelpers: ArrayHelpers<any[]>) => (
<div>
<div className="w-full">
{formikProps.values.custom_config_list.map((_, index) => {
return (
<div
key={index}
className={index === 0 ? "mt-2" : "mt-6"}
className={(index === 0 ? "mt-2" : "mt-6") + " w-full"}
>
<div className="flex">
<div className="flex w-full">
<div className="w-full mr-6 border border-border p-3 rounded">
<div>
<Label>Key</Label>
Expand Down Expand Up @@ -457,6 +458,7 @@ export function CustomLLMProviderUpdateForm({
<Button
type="button"
variant="destructive"
className="ml-3"
icon={FiTrash}
onClick={async () => {
const response = await fetch(
Expand Down

0 comments on commit 75a448c

Please sign in to comment.