Skip to main content

A lightweight client for local LLM APIs like Ollama or OpenWebUI

Project description

volt-llm-client

volt-llm-client is a lightweight Python client for interacting with local LLM APIs such as Ollama or OpenWebUI.
It supports prompt completion, multi-turn conversations, and model listing — perfect for scripts, prototypes, or CLI tools.


Features

  • Send single prompts or full conversations
  • Compatible with Ollama/OpenWebUI-style APIs
  • Token-based authentication support
  • Clean log output using volt-logger
  • Minimal dependencies (requests only)

Installation

Install both volt-llm-client and its logging dependency:

pip install volt-llm-client

For local development:

git clone https://github.com/stuarttempleton/volt-llm-client.git
cd volt-llm-client
pip install -r requirements.txt

Usage Example

import os
from voltllmclient import LLMClient

llm = LLMClient(
    token=os.getenv("LLM_API_TOKEN"),
    model="Gemma3"
)

reply = llm.send_prompt("What is the capital of France?")
print(reply)

You can also send a full conversation:

messages = [
    { "role": "system", "content": "You are a helpful assistant." },
    { "role": "user", "content": "Who won the World Cup in 2018?" }
]

response = llm.send_conversation(messages)
print(response)

Maintaining Context with LLMConversation

from voltllmclient import LLMConversation
import os

conv = LLMConversation(model="gemma3", token=os.getenv("LLM_API_TOKEN"))

response = conv.send("What is quantum computing?")
print(response)

response = conv.send_with_full_context("How is it different from classical computing?")
print(response)

conv.save_transcript("session.json")

Environment Variables

Set your API token via environment variable:

Unix/macOS:

export LLM_API_TOKEN=your_token_here

PowerShell:

$env:LLM_API_TOKEN = "your_token_here"

License

MIT

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

volt_llm_client-0.1.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

volt_llm_client-0.1.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file volt_llm_client-0.1.2.tar.gz.

File metadata

  • Download URL: volt_llm_client-0.1.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for volt_llm_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1af58119c3aff06bca19e12cac53235f2b2a64ab0d2c1781a95cf9f5db7f1711
MD5 cfdde9e18c6a51d42027e3f3a4174266
BLAKE2b-256 6e9b3d4e8cce1e781f4b77337b73a6a6553e680abf4c7868752080875fa21f36

See more details on using hashes here.

Provenance

The following attestation bundles were made for volt_llm_client-0.1.2.tar.gz:

Publisher: publish.yml on stuarttempleton/volt-llm-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file volt_llm_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for volt_llm_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3a8c05688147aaacdb3afa5ec001e20e6e28551a347baea74869ef02ec05202
MD5 78345334898c3184343456c4f61c66dd
BLAKE2b-256 e4a8893a3c99f2185b2497dcf6a46d8e79ef33a70fb13f460aa0af9a90ef4c0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for volt_llm_client-0.1.2-py3-none-any.whl:

Publisher: publish.yml on stuarttempleton/volt-llm-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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