ollama / ollama-python

Ollama Python library
https://ollama.com
MIT License
2.75k stars 227 forks source link

Is there a command that just serves the REST api , similar to ollama run on the cli #23

Closed gregnwosu closed 5 months ago

gregnwosu commented 5 months ago

I want to serve the API from python in a similar way as

ollama run mistral

maybe that returns a server reference that can be used to shutdown the model once done. Happy to contribute if there is a need

furqanalishah commented 5 months ago

@gregnwosu thanks. Could please tell us about a use case when you would need it?

mxyng commented 5 months ago

This project is intended to be a thin client library for the Ollama API. A running ollama instance is required. You can change which instance the library uses by manually creating a client ollama.Client(host='') or by setting OLLAMA_HOST