https://github.com/fuelsoft/pyllmadapter
A simple Ollama adapter for Python
https://github.com/fuelsoft/pyllmadapter
ollama-api python3
Last synced: 3 days ago
JSON representation
A simple Ollama adapter for Python
- Host: GitHub
- URL: https://github.com/fuelsoft/pyllmadapter
- Owner: fuelsoft
- License: gpl-3.0
- Created: 2025-01-30T04:15:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-22T23:02:22.000Z (over 1 year ago)
- Last Synced: 2025-02-23T00:21:28.607Z (over 1 year ago)
- Topics: ollama-api, python3
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyLLMAdapter
## A simple Python adapter for your Ollama instance
This is the core `Ollama.py` library file and a set of example scripts, including:
* `ask.py` for one time message-and-answer
* `chat.py` to have a multi-message conversation with an LLM
* `complete.py` to demonstrate the fill-in-the-blank ability of some models
* `inspect.py` to send an image and have the LLM analyze the contents
* `unload.py` to quickly unload all models from the command line
These examples all assume that you're running your Ollama instance on your local machine (`localhost:11434`). You can pass IP and port to the constructor to override this.
All examples use sensible default models. You can change them to whatever you'd like, but keep model ability and intended use-case in mind.
*I am aware that there is an official Ollama Python library and I don't care, I'm not installing it when I could get everything I need done in less than 300 lines.*