Skip to main content

No project description provided

Project description

vaklm

Easy interaction with OpenAI-compatible LLM endpoints.

No more client.chat.completions.create verbosity!

Installation

pip install vaklm

Usage

from vaklm import vaklm, VAKLMException

print("Non-streaming example:")
try:
    response = vaklm(
        endpoint="http://localhost:11434/v1/chat/completions",
        model_name="llama3.2:latest",
        user_prompt="Write a short story about a cat.",
        system_prompt="You are a creative writer.",
        api_key="YOUR_API_KEY",
        temperature=0.7
    )
    print(response)
except VAKLMException as e:
    print(f"Error: {str(e)}")
from vaklm import vaklm

print("\nStreaming example:")
try:
    for chunk in vaklm(
        endpoint="http://localhost:11434/v1/chat/completions",
        model_name="llama3.2:latest",
        user_prompt="Write a short story about a cat.",
        system_prompt="You are a creative writer.",
        api_key="YOUR_API_KEY",
        stream=True,
        temperature=0.7
    ):
        print(chunk, end='', flush=True)
except VAKLMException as e:
    print(f"Error: {str(e)}")

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

vaklm-0.2.2.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

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

vaklm-0.2.2-py3-none-any.whl (1.5 kB view details)

Uploaded Python 3

File details

Details for the file vaklm-0.2.2.tar.gz.

File metadata

  • Download URL: vaklm-0.2.2.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for vaklm-0.2.2.tar.gz
Algorithm Hash digest
SHA256 358ae9ffd7b05d83e48c33aee42d6bfd71d2c1abcadfddcf5e9d663a4cb1d21a
MD5 a8d1df666c53377440bbc0b8b63dd7ce
BLAKE2b-256 b4032ed00fe5f8770bd608c41b73d39bb21bc4f618b57801f81031e97ecddabc

See more details on using hashes here.

File details

Details for the file vaklm-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: vaklm-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 1.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for vaklm-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 606909b316e80ae834d6b4cffb6607dfc6ab86202ef1a25fe6af7009a1d0abce
MD5 a09251a7ac3985508f90d3e5cab607e5
BLAKE2b-256 439ba97fdf7767e049017f99252c8c050210295077d963f34a5393e34c51e420

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