Add better vertex support + LLM form cleanup

This commit is contained in:
Weves 2024-12-09 13:13:25 -08:00 committed by Chris Weaver
parent dc5d5dfe05
commit 30dfe6dcb4
2 changed files with 12 additions and 6 deletions

View File

@ -268,12 +268,16 @@ class DefaultMultiLLM(LLM):
# 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:

View File

@ -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">
@ -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>
@ -457,6 +458,7 @@ export function CustomLLMProviderUpdateForm({
<Button
type="button"
variant="destructive"
className="ml-3"
icon={FiTrash}
onClick={async () => {
const response = await fetch(