Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better vertex support + LLM form cleanup #3384

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading