-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[Feature]: Add support for Llamafile provider #3225
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
Comments
@rupurt they're openai-compatible https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#json-api-quickstart You can already call them with litellm - https://docs.litellm.ai/docs/providers/openai_compatible Let me know if there's anything i'm missing. |
The problem with just using
If neither are present (e.g. Given that Llamafile doesn't need an API key, then I'd suggest the See: https://docs.litellm.ai/docs/providers/vllm e.g. from litellm import completion
msg = "What is the meaning of life?"
messages = [{"content": msg, "role": "user"}]
response = completion(
model="hosted_vllm/Mistral-7B-Instruct-v0.2",
base_url="http://127.0.0.1:8080/v1",
messages=messages,
)
reply = response["choices"][0]["message"]["content"]
print("Completion Result:\n")
print(f"User: {msg}\n\nAssistant: {reply}\n{'-' * 40}") |
Hey @peteski22 that's fair - would you be able to contribute a PR for this? |
Thanks @krrishdholakia, I'll take a look into it and see if I can raise a PR (it might not be immediate though) 😄. |
Hey again @krrishdholakia, sorry for the delay. I've created #10203. If you have any time to review it, I'd be glad to get your feedback and see if anything needs to be done to move it along/get it merged. Thanks 😄 |
Left comments there |
The Feature
Support connecting to Llamafile models https://github.com/Mozilla-Ocho/llamafile
Motivation, pitch
It's a self contained format to run models as a single binary
Twitter / LinkedIn details
https://twitter.com/rupurt
The text was updated successfully, but these errors were encountered: