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.1.tar.gz (6.3 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.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for volt_llm_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c4b3ce40cb9c31b68c4153f37e388b32d404e62036ca2f66f1fc22c13f0d4ac8
MD5 91c184d5ffa8149d6a79b8c8229d5964
BLAKE2b-256 9be19b08b847b4900c12f1abd79fc2ecb48477f129d200c4e71922675ffe65ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for volt_llm_client-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for volt_llm_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 addc26a21ac453024ccef1994dae7487e4e6eb9e15abf256da40c1f527b22cf6
MD5 72266e0b6027a74d0a1b739aeee684ea
BLAKE2b-256 679f62f3f857c034a1a9eccd0b4e820a6980f03a76544061200baabd5095c36e

See more details on using hashes here.

Provenance

The following attestation bundles were made for volt_llm_client-0.1.1-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