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

Uploaded Python 3

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

Hashes for volt_llm_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab9f0babe51702a3f46531dc90f7930fee5eb0c1d73fc5bd1cd6618327005fe4
MD5 22488bbed436043e59a9fbceaf748f34
BLAKE2b-256 649747af320fb47229c958fb3609ee8bb6ce42db61ef927a27930502bd5363bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for volt_llm_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 513f10047ada59bf10652281fe1d3ab90d79d0cf91039264247f6f2aac83ea53
MD5 9fef61332f9ed1e1663ca0f7d61839c3
BLAKE2b-256 6f8ae704205ecde37edbdd47ba8cbc262be86d8459de633c6cfb54dd2322ddf5

See more details on using hashes here.

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

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