Skip to main content

Python SDK for Tether QVAC — local-first AI inference on any device

Project description

qvac-sdk

Python SDK for Tether QVAC — local-first AI inference on any device.

QVAC runs AI models entirely on-device with no cloud dependency. This SDK provides a Pythonic interface to QVAC's inference capabilities: LLM completions, image generation, speech-to-text, translation, TTS, OCR, and embeddings.

Installation

pip install qvac-sdk

With OpenAI-compatible client support:

pip install qvac-sdk[openai]

Quick start

Direct API

from qvac_sdk import QVACClient

client = QVACClient()  # connects to local QVAC instance

# LLM completion
response = client.complete("Explain quantum computing in one paragraph")
print(response.text)

# Streaming
for chunk in client.complete_stream("Write a haiku about edge AI"):
    print(chunk.text, end="")

Async

from qvac_sdk import AsyncQVACClient

async def main():
    client = AsyncQVACClient()
    response = await client.complete("Hello from async Python")
    print(response.text)

OpenAI-compatible mode

QVAC exposes an OpenAI-compatible API via qvac serve openai. This SDK wraps it natively:

from qvac_sdk.openai_compat import QVACOpenAI

client = QVACOpenAI()  # points to local QVAC OpenAI endpoint

response = client.chat.completions.create(
    model="local",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Speech-to-text

transcript = client.transcribe("meeting.wav")
print(transcript.text)

Image generation

image = client.generate_image("A cat riding a bicycle", width=512, height=512)
image.save("cat.png")

Embeddings

vectors = client.embed(["sentence one", "sentence two"])
print(vectors.shape)  # (2, 384)

Configuration

client = QVACClient(
    base_url="http://localhost:8080",  # QVAC instance URL
    timeout=30.0,                       # request timeout in seconds
    model="default",                    # model name override
)

Environment variables:

Variable Default Description
QVAC_BASE_URL http://localhost:8080 QVAC API endpoint
QVAC_TIMEOUT 30.0 Request timeout (seconds)
QVAC_MODEL default Default model name

Supported capabilities

Capability Method Status
LLM completion complete() / complete_stream() Planned
Chat (multi-turn) chat() / chat_stream() Planned
Speech-to-text transcribe() Planned
Translation translate() Planned
Text-to-speech speak() Planned
Image generation generate_image() Planned
OCR ocr() Planned
Embeddings embed() Planned
LoRA fine-tuning finetune() Planned
OpenAI compat qvac_sdk.openai_compat Planned

Development

git clone https://github.com/kinance/qvac-sdk
cd qvac-sdk
pip install -e ".[dev]"
ruff check .
mypy src/
pytest

License

Apache 2.0 — same as QVAC.

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

qvac_sdk-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

qvac_sdk-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qvac_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for qvac_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15803e035fd74b94d4f5a7fb28be7fe2b17b93eefc87cee84fb542dfeb18e3f1
MD5 164ebc20c8fa0a2271c69325a0d76c56
BLAKE2b-256 c3cff20679f13cb33d99a55df4b81fc5991ab063420378003c14c2612211f93a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qvac_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for qvac_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4febb537738e48c691dade7e478d6b1e63c83e970de6d1bc14b54cd4d039dd22
MD5 9781c2a8a0dd27251909d1231d20a34a
BLAKE2b-256 6f7a80bfbac7b1fc1699402b459adff02d82d867dac85dd43bdd57a51371f653

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