A lightweight Python client for Ollama with context management and streaming support.
Project description
🐪 Camel-ollama
A lightweight Python client for Ollama that makes it easy to:
- Chat with models (supports streaming or one-shot responses).
- Persist and reload conversation context.
- Manage models (list, pull, delete).
- Generate embeddings.
🚀 Installation
pip install camel-py
Quickstart example
from camel import CamelClient
with CamelClient(model="llama3") as client:
# Simple one-shot response
resp = client.chat("Hello, who are you?")
print(resp.text)
# Streaming response
print("Assistant: ", end="")
resp = client.stream("Tell me a joke about camels")
print(resp.text)
📂 Examples
See the examples/ directory for more examples.
- advanced_chat.py → context persistence across sessions
🔧 Features
- Streaming API: real-time token streaming (.stream()).
- Context management: save/load/clear conversation history.
- Model management: list, pull, and delete Ollama models.
- Embeddings: generate embeddings for text.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
camel_py-0.1.1.tar.gz
(8.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file camel_py-0.1.1.tar.gz.
File metadata
- Download URL: camel_py-0.1.1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cadc2916545620dfed6a572d4d768e64a9c60a2725a3baf6236900901544725e
|
|
| MD5 |
c7db33c6eabf5e71fad9d69bfca05a3a
|
|
| BLAKE2b-256 |
6add7dd2a53f0e92d19b045bc548a4d24b828864e1e5ab8b381bc365bdff3a89
|
File details
Details for the file camel_py-0.1.1-py3-none-any.whl.
File metadata
- Download URL: camel_py-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68451564b0e409ad7834f488fcd683aa5464ecac2c1f9c7adf0148555543a2f6
|
|
| MD5 |
3c011bd85906b4b109e833504738a786
|
|
| BLAKE2b-256 |
2dc4b1132c32018a020f3fd61d4d4eedc23b4b10d9e44a0a65cd940855f28c9c
|