-
Notifications
You must be signed in to change notification settings - Fork 555
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
feat: add support Ollama backend & bump golang to 1.22 #1065
base: main
Are you sure you want to change the base?
Conversation
@yankay this looks similar with localai's backend which utilizes openai's API 🤔 |
HI @arbreezy Like OpenAI and AzureOpenAI, they are similar but different projects. https://hyscaler.com/insights/ollama-vs-localai-open-source-local-llm-apis/ . So, it needs to be implemented as 2 Providers. ref: How do you think about that :-) |
Azure OpenAI is slightly different but I get your argument I don't have a strong opinion on adding another file for any thoughts on that @AlexsJones @matthisholleville ? |
Thanks @arbreezy Ollama has an official go client. https://github.com/ollama/ollama/blob/main/api/client.go |
@yankay I think this makes more sense, any thoughts on that @AlexsJones @matthisholleville ? |
I agree, thanks |
9a64da0
to
1d4ee29
Compare
Thanks @AlexsJones @arbreezy It has been changed to use the Ollama official go client. https://github.com/ollama/ollama/blob/main/api/client.go Would you please help to review it? :-) |
req := &ollama.GenerateRequest{ | ||
Model: c.model, | ||
Prompt: prompt, | ||
Stream: new(bool), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is that bool defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @AlexsJones
The bool is defined at https://github.com/ollama/ollama/blob/main/api/types.go#L62 ,
Because the default value of the stream is true, it needs to be set as false.
Then resp.Response
can return as a string.
How do you think about that:-)
7070887
to
1931f6b
Compare
Signed-off-by: Kay Yan <[email protected]>
Closes #1064
📑 Description
The Ollama can make it easier for users to interact with K8SGPT.
Support Ollama backend with Ollama API.
Because Ollama API requires golang v1.22 , so upgrade the golang to v1.22
Usage:
Next TODO things:
✅ Checks
ℹ Additional Information