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

WIP litellm integration #320

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

WIP litellm integration #320

wants to merge 2 commits into from

Conversation

JamesGuthrie
Copy link
Member

No description provided.

@JamesGuthrie JamesGuthrie requested a review from a team as a code owner December 18, 2024 12:08
Copy link
Contributor

@Askir Askir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it generally looks good:

  • I wonder if there is a way to load the secrets directly from env vars instead of having to provide them in the function call.
  • I'd also like to simplify passing in extra arguments but idk if sql functions allow *args or **kwargs I guess not

( %s
, 'hello world'
, api_key=>%s
, extra_options => jsonb_build_object('input_type', %s::text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is no way of directly taking any additional arguments as an "extra option"? without wrapping it in a jsonb and passing it as an extra param?

Comment on lines +272 to +275
, extra_options => jsonb_build_object(
'aws_access_key_id', %s::text,
'aws_secret_access_key', %s::text,
'aws_region_name', %s::text
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to autoload these from env vars if they exist? same for the api_key

select vector_dims
(
ai.litellm_embed
( %s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda wonder why litellm has no provider argument, I feel like model names will collide eventually.

plpy.error(f"missing {secret_name} secret")
# This line should never be reached, but it's here to make the type checker happy.
return ""
return None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there existing code that depends on this condition throwing an error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I still need to do a full audit of all of the callers.

@jgpruitt
Copy link
Collaborator

lookin' good

TODOs:
- tests for all integrations
- fine-tune configuration parameters
- fine-tune huggingface (cold-start?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants