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.3.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.3-py3-none-any.whl (1.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vaklm-0.2.3.tar.gz
Algorithm Hash digest
SHA256 75f2ca5c5a83956c2b861a12b4775c9a4d5e1cf1add878a9e591439069a77fca
MD5 af50913a1fa8f8aea5283b68ce8779fd
BLAKE2b-256 c4520d149015d6d772eca15acebb6278cc2204f238361d9ea62e1e378a94b42c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vaklm-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3841a36059b54fc38dfcf3eb9f2e39d0338b893d264aa5618fceaecaccb23c77
MD5 b258402f01cab9a582e7d9a45c38d4f3
BLAKE2b-256 8b9db79dc5af36eb669a037d635105d37799aeb29b1d4e808d84d706e92736b2

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