openai-clojure icon indicating copy to clipboard operation
openai-clojure copied to clipboard

Open LLama Compatibility

Open markbastian opened this issue 1 year ago • 1 comments

Ollama has announced OpenAI API compatibility and the Llama API website has documentation examples using the Python OpenAI client. It would be great to see this library work with the Llama API as well.

markbastian avatar Feb 08 '24 22:02 markbastian

Hello!

We have the ability to override the openai endpoint in options: https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.15.0/doc/usage-openai#options

Maybe it already works?

wkok avatar Feb 09 '24 18:02 wkok

I can confirm it works. Here is a snippet I was able to successfully run.

(api/create-chat-completion {:model "llama3.1"
                                            :messages [{:role "user"
                                                        :content "why are my eyes blue?"}]
                                            :stream true
                                            :on-next #(prn %)}
                                           {:api-key "key"
                                            :api-endpoint "http://localhost:11434/v1"})

jkreed avatar Jul 30 '24 22:07 jkreed

I can confirm it works. Here is a snippet I was able to successfully run.

Thanks for confirming!

wkok avatar Jul 31 '24 05:07 wkok