Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Use ollama python client for completion - #241

Merged
aponcedeleonch merged 3 commits into
mainfrom
ollama-litellm
Dec 10, 2024
Merged

aponcedeleonch merged 3 commits into
mainfrom
ollama-litellm

Conversation

@aponcedeleonch

Copy link
Copy Markdown
Member

Until now we had been using self-made calls to Ollama. The problem is that the output of the calls didn't follow the standard format of the other calls. Initally I tried to implement Ollama completion calls with LiteLLM but also their interfaces seem quite broken. I was getting errors using their method acompletion and everytime that I set stream=False. Hence I resorted to use python's official Ollama client and implemented normalizers for it

Comment thread src/codegate/codegate_logging.py
Comment thread src/codegate/llm_utils/llmclient.py

@ptelang ptelang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tested this change and it works as expected. Great job!

Until now we had been using self-made calls to Ollama. The problem
is that the output of the calls didn't follow the standard format
of the other calls. Initally I tried to implement Ollama completion
calls with LiteLLM but also their interfaces seem quite broken. I was
getting errors using their method `acompletion` and everytime that I set
`stream=False`. Hence I resorted to use python's official Ollama client
and implemented normalizers for it

@ptelang ptelang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants