Skip to main content

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

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.

🔧 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


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.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

camel_py-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file camel_py-0.1.0.tar.gz.

File metadata

  • Download URL: camel_py-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for camel_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d114a7f8ff4a6f5a9dcd44acabe2cfd14e3df7a2e7f7118911b6d4664385eec9
MD5 f5d386f6a820753fbd89f38a94dc9ce5
BLAKE2b-256 c937ce4d2a6be82fb8c5bb64501e974c56aed6bd9ec5776b7d391ef9068ae6de

See more details on using hashes here.

File details

Details for the file camel_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: camel_py-0.1.0-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

Hashes for camel_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c69f5c99512cb4f8cc84cd6d3a3b404c920e4c3d5530a8b6549e028c8427a5c0
MD5 487687dbbe4b287821ba6ffd0303b9a8
BLAKE2b-256 d4fab554a02903802038d150697a70bb3396eae3a206051a3eebb4b0fc080ca6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page