Skip to main content

Python client for the Vondr AI Platform.

Project description

vondr

Python client for the Vondr AI Platform.

Installation

pip install vondr

For image support (vision):

pip install vondr[images]

Quick Start

from vondr import VondrClient

# Set environment variables or pass directly
# VONDR_API_KEY=your-api-key
# VONDR_BASE_URL=https://{HOSTNAME}-api.vondr.ai/v1

with VondrClient() as client:
    response = client.chat([
        {"role": "user", "content": "Hello!"}
    ])
    print(response.choices[0].message.content)

Chat Completion

response = client.chat(
    messages=[{"role": "user", "content": "Explain quantum computing"}],
    model="vondr-fast",  # or vondr-code, vondr-think
    temperature=0.7,
    max_tokens=4096,
)
print(response.choices[0].message.content)

Embeddings

response = client.embed(
    input=["Hello world", "Goodbye world"],
    model="vondr-embed-dense",  # or vondr-embed-sparse
)
for item in response.data:
    print(f"Embedding {item.index}: {len(item.embedding)} dimensions")

Rerank

response = client.rerank(
    query="capital of France",
    documents=["Paris is in France", "Berlin is in Germany"],
    model="vondr-rerank",
)
for result in response.results:
    print(f"Document {result.index}: score {result.relevance_score:.3f}")

Vision (Images)

from vondr import VondrClient, encode_image

with VondrClient() as client:
    # Encode image from file path
    image_uri = encode_image("/path/to/image.jpg")

    response = client.chat([
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What's in this image?"},
                {"type": "image_url", "image_url": {"url": image_uri}}
            ]
        }
    ])
    print(response.choices[0].message.content)

Async Client

from vondr import AsyncVondrClient

async with AsyncVondrClient() as client:
    response = await client.chat([
        {"role": "user", "content": "Hello!"}
    ])
    print(response.choices[0].message.content)

Available Models

Model Description
vondr-fast Fast general-purpose model
vondr-code Optimized for code generation
vondr-think Reasoning model with thinking budget
vondr-embed-dense Dense embeddings
vondr-embed-sparse Sparse embeddings
vondr-rerank Document reranking

Configuration

Environment Variable Description
VONDR_API_KEY Your API key
VONDR_BASE_URL API base URL (e.g., https://{HOSTNAME}-api.vondr.ai/v1)

Development

poetry install
poetry run pytest

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

vondr-0.2.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

vondr-0.2.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file vondr-0.2.0.tar.gz.

File metadata

  • Download URL: vondr-0.2.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.6.0

File hashes

Hashes for vondr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ed4f2eea21041634e617bb49945d00562f1557dd8ad206661c79f8325c4102c7
MD5 b4b4960748a64ed6c161bf6ff0bbdcfa
BLAKE2b-256 ec3ef02b721ead1cea9cc2e648304db1c2be06cf649d7484452f0295c0db1d84

See more details on using hashes here.

File details

Details for the file vondr-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vondr-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.6.0

File hashes

Hashes for vondr-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a692fc13c70cd0615e38d2d3ab7db856aeb4792b02f54ed909982516d0fe665c
MD5 565072b0ce3a601296f46bcb6e7ade8b
BLAKE2b-256 2085139296396c2fbc6989f0d7d86ecdcb51c9d30cbd172c94fcdb9d4af3aa46

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