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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: vaklm-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 22ce9e5297f9e2d07758413849c4d910de8452947fc947ed07cf148b83a948f5
MD5 4b78758eb21b710dbff13a3b136cea82
BLAKE2b-256 72ad78532dabefb0f5c099f51c6c48d62e1f49460402ca2a9c89172e35a42981

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vaklm-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cef099ce2ab10769b488014678ff9489d4363c5779cb05731f23de2b44eda4e8
MD5 f9b69459e91f48d84182b1614a410bcf
BLAKE2b-256 d5d87e634f4fd4f36b4b1bfd64b346f1f10a521f7f0d02e597d72e6d187f37b7

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