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 promptllm

# Non-streaming example
response_data = promptllm(
    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
for chunk in promptllm(
    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
):
    print(chunk)

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: vaklm-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 da92b6fcb1c42be286b9a95cc611d99ae9caabbaaba414f5937c27f0933979cc
MD5 d50424e21031f03b254c43cfb36efcfa
BLAKE2b-256 eea51ad28c6f38336026c16213ae69aa6d90c8f681d5dfbf72c6d3b265fab394

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vaklm-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88909e9c48a36221950681b424c280faec8acd6407cc40ac8d499d8af50a9f4a
MD5 64ea4ef46ff3482105a15019748d9c4c
BLAKE2b-256 e36edbe05eed7c454d69e7bf8be94502b2b46ec0325f4bfe9d1663b8c61f7300

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