EZollama
A simple Python library for interacting with Ollama models via their local API and cloud models through Google, Groq, OpenAI and Anthropic.
Supports model selection, chatting, persistent system prompts, listing models, downloading models, resetting chat history, and text-to-speech.
Installation
-
Install Ollama:
Download and install Ollama from https://ollama.com/download.
The library will prompt to install Ollama if not found. -
Python dependencies:
The library auto-installspyttsx3for text-to-speech if missing.
Usage for local
Import
from ezollama import EzOllama
ez = EzOllama()
Set Model
ez.set_model("llama2")
Set Persistent System Prompt
ez.set_system_prompt("You are a helpful assistant.")
Chat
response = ez.chat("Hello!")
print(response)
List Available Models
models = ez.list_models()
print(models)
Pull (Download) a Model
ez.pull_model("llama2")
Reset Chat History
ez.reset_history()
Text-to-Speech
ez.text_to_speech("Hello, this is AI speaking.")
Usage for cloud
Import
from ezollama import EzOllama
ez = EzOllama()
Set mode
ez.set_mode("mode", "api-key") # choosable from groq, google, anthropic and openai
Set model
ez.set_model("model") # for example 'gemini-2.5-flash
Set Persistent System Prompt
ez.set_system_prompt("You are a helpful assistant.")
Example for local
from ezollama import EzOllama
ez = EzOllama()
ez.set_model("llama3.2:3b")
ez.set_system_prompt("You are a friendly assistant.")
while True:
user_input = input("- ")
resp = ez.chat(user_input)
print(resp)
ez.text_to_speech(resp)
Example for cloud
from ezollama import EzOllama
ez = EzOllama()
ez.set_mode("google" "API-KEY")
ez.set_model("gemini-2.5-flash")
ez.set_system_prompt("You are a friendly assistant.")
while True:
user_input = input("- ")
resp = ez.chat(user_input)
print(resp)
Notes
- The library checks and quietly starts the Ollama server before each API call.
- If Ollama is not installed, you will be prompted to install it.
- If the model does not exist,
pull_modelwill print a message. - Text-to-speech uses
pyttsx3and works cross-platform.
Metadata
Release files for ezollama 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ezollama-0.2.4.tar.gz | 5.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ezollama-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / ezollama-0.2.4.tar.gz
| Download URL | ezollama-0.2.4.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
415a7d812f0e554462487776c52f34f005cadb033499e27fcbfaede09aa38469
|
|
BLAKE2b-256 checksum How to use checksums |
5fbdec1990b0ed47d6e2fc6a393964e3a680ca29b602eb0cbd966ca9c1bccf45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / ezollama-0.2.4-py3-none-any.whl
| Download URL | ezollama-0.2.4-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
defe1713ae9a7634509274ee630ddcdc49b3c2ed011afc1197bb160cafe04e05
|
|
BLAKE2b-256 checksum How to use checksums |
7b4a352c2f1ac3969ba1ab5a35ea92ce376528bb4a5e6d36150578193ee6ce91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|