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.5.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.5-py3-none-any.whl
(3.9 kB
view details)
File details
Details for the file vaklm-0.2.5.tar.gz.
File metadata
- Download URL: vaklm-0.2.5.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 |
bb2550080c8b07acdd1f4cc6414b30f7fd83486de72df891d12c32802bd618df
|
|
| MD5 |
77567ee6c21b7e5918f19b3932e4b559
|
|
| BLAKE2b-256 |
cb4330f875df11cb7bcd16bc839b149d130d4204530c6167aefb841a2779c74e
|
File details
Details for the file vaklm-0.2.5-py3-none-any.whl.
File metadata
- Download URL: vaklm-0.2.5-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 |
3f41b28b8ef3af4966ad2dac2cd548662a6f53dac7cec6f96e578635f47a27e0
|
|
| MD5 |
278f0deeb2fbf03771c1a6c6ba08d5a1
|
|
| BLAKE2b-256 |
c7b365e94513a2cb755963df0a5c5c57e4fc6788dcef874271a08da6fea49a37
|