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 (
requestsonly)
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
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
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 volt_llm_client-0.1.0.tar.gz.
File metadata
- Download URL: volt_llm_client-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab9f0babe51702a3f46531dc90f7930fee5eb0c1d73fc5bd1cd6618327005fe4
|
|
| MD5 |
22488bbed436043e59a9fbceaf748f34
|
|
| BLAKE2b-256 |
649747af320fb47229c958fb3609ee8bb6ce42db61ef927a27930502bd5363bb
|
Provenance
The following attestation bundles were made for volt_llm_client-0.1.0.tar.gz:
Publisher:
publish.yml on stuarttempleton/volt-llm-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
volt_llm_client-0.1.0.tar.gz -
Subject digest:
ab9f0babe51702a3f46531dc90f7930fee5eb0c1d73fc5bd1cd6618327005fe4 - Sigstore transparency entry: 244894602
- Sigstore integration time:
-
Permalink:
stuarttempleton/volt-llm-client@0a4394c3ce903acede7a1227c3b3647bec648595 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/stuarttempleton
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a4394c3ce903acede7a1227c3b3647bec648595 -
Trigger Event:
push
-
Statement type:
File details
Details for the file volt_llm_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: volt_llm_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
513f10047ada59bf10652281fe1d3ab90d79d0cf91039264247f6f2aac83ea53
|
|
| MD5 |
9fef61332f9ed1e1663ca0f7d61839c3
|
|
| BLAKE2b-256 |
6f8ae704205ecde37edbdd47ba8cbc262be86d8459de633c6cfb54dd2322ddf5
|
Provenance
The following attestation bundles were made for volt_llm_client-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on stuarttempleton/volt-llm-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
volt_llm_client-0.1.0-py3-none-any.whl -
Subject digest:
513f10047ada59bf10652281fe1d3ab90d79d0cf91039264247f6f2aac83ea53 - Sigstore transparency entry: 244894605
- Sigstore integration time:
-
Permalink:
stuarttempleton/volt-llm-client@0a4394c3ce903acede7a1227c3b3647bec648595 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/stuarttempleton
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a4394c3ce903acede7a1227c3b3647bec648595 -
Trigger Event:
push
-
Statement type: