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

# Non-streaming example
response_data = vaklm(
    endpoint="http://localhost:11434/v1/chat/completions",
    model_name="llama2",
    user_prompt="Write a short story about a cat.",
    system_prompt="You are a creative writer.",
    api_key="YOUR_ACTUAL_API_KEY" # can be any value of local LLM
)
if response_data:
    print("API Response:")
    print(response_data)

# Streaming example
vaklm(
    endpoint="http://localhost:11434/v1/chat/completions",
    model_name="llama2",
    user_prompt="Write a short story about a cat.",
    system_prompt="You are a creative writer.",
    api_key="YOUR_ACTUAL_API_KEY",
    stream=True
)

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.1.0.tar.gz (1.5 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.1.0-py3-none-any.whl (1.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vaklm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 731235fa08eabaeb43e5a377ff2ac4e99f1b2fd321720d655b98c7bc542e6928
MD5 f254f3517c583d8c55b1216254143a9a
BLAKE2b-256 f272b69871a5d2d65195e670458d638b4211c051bbd446b1f87e6502fcea425a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vaklm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73e228076c586a25f2b8204793ae1479b55de60d3607fd601a3a206f86b57bc6
MD5 1781fe9b7cb29fe7d2843f146ac0ac00
BLAKE2b-256 6ef83cabc01bee008f96d1fcbe1ae30495d89a5d7a3daa934f57e80463c0c960

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