pydantic-ai icon indicating copy to clipboard operation
pydantic-ai copied to clipboard

Ollama vs. OpenAI: Shouldn't we just have OpenAI support (as Ollama supports OpenAI)?

Open ChristianWeyer opened this issue 11 months ago • 1 comments

Hey all,

first, thanks for the great lib! :-)

Looking at https://ai.pydantic.dev/api/models/openai/ and https://ai.pydantic.dev/api/models/ollama/ I am wondering why not just have the OpenAI one and provide e.g. a base URL property?

As Ollama implements the OAI API, this seems like a streamlined way to do. Then we can use OpenAI() for both real OpenAI and local / remote inference engines like Ollama.

Thoughts?

ChristianWeyer avatar Dec 13 '24 11:12 ChristianWeyer

i yess thats what I was talking about.

Navanit-git avatar Dec 13 '24 12:12 Navanit-git

I think it's worth having a dedicated model, even if it's just setting the base url.

Also, look like we'll need more specific support for Ollama, see #242.

samuelcolvin avatar Dec 14 '24 08:12 samuelcolvin

Then we should at least have the base URL setting in the OpenAI model - OK @samuelcolvin?

ChristianWeyer avatar Dec 16 '24 10:12 ChristianWeyer