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
Release history Release notifications | RSS feed
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.4.tar.gz
(3.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
vaklm-0.2.4-py3-none-any.whl
(3.9 kB
view details)
File details
Details for the file vaklm-0.2.4.tar.gz.
File metadata
- Download URL: vaklm-0.2.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d81ba368900fb3a5fe822a59c9d9a5399844a091caee9463c1cf4604f4938316
|
|
| MD5 |
f50809d1578d7eaeeb93f3d47c9b51cc
|
|
| BLAKE2b-256 |
1358447860e1e5d24d5a11254c91b18410d5d771f4384f32726e31b48bb14519
|
File details
Details for the file vaklm-0.2.4-py3-none-any.whl.
File metadata
- Download URL: vaklm-0.2.4-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ea7ada0e7a380f74ed289ceb4daa9b67b341874491bd11d6c7925f9cc62fd86
|
|
| MD5 |
94492ee8229504806ea39616f7c5182a
|
|
| BLAKE2b-256 |
d9de5c8df5e5cdd6ac7580f254870b8254d7d3738dd5816e605506e77c97304a
|