Lightweight, easy, and consistent LLM-interface across providers and functionality.
Project description
sik-llms
- Easy llm interface; eliminates parsing json responses or building up json for functions/tools
- OpenAI and any OpenAI-compatible API
- Anthropic
- Sync and Async support
- Functions/Tools
- Structured Output
- Supports Anthropic models even though structured output is not natively supported in their models
- Reasoning mode in OpenAI and Anthropic
- ReasoningAgent that iteratively reasons and calls tool
See examples
from sik_llms import create_client, user_message, ResponseChunk
model = create_client(
model_name='gpt-4o-mini', # or e.g. 'claude-3-7-sonnet'
temperature=0.1,
)
messages = [
system_message("You are a helpful assistant."),
user_message("What is the capital of France?"),
]
# sync
response = model(messages=messages)
# async
response = await model.run_async(messages=messages)
# async streaming
responses = []
summary = None
async for response in model.stream(messages=messages):
if isinstance(response, TextChunkEvent):
print(response.content, end="")
responses.append(response)
else:
summary = response
print(summary)
Installation
uv install sik-llms or pip install sik-llms
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
sik_llms-0.3.26.tar.gz
(161.5 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
sik_llms-0.3.26-py3-none-any.whl
(40.7 kB
view details)
File details
Details for the file sik_llms-0.3.26.tar.gz.
File metadata
- Download URL: sik_llms-0.3.26.tar.gz
- Upload date:
- Size: 161.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08f696aff1d52ba59b2f680ed6ec4c9c959bc411c3a45b87252493097e21f4ac
|
|
| MD5 |
43fa3a8b8c28d541cc2519625f45ba1b
|
|
| BLAKE2b-256 |
236f02792e51ee3b0d6a035c4fd3af02ea0413f9bce52a34e118d99302dc7c57
|
File details
Details for the file sik_llms-0.3.26-py3-none-any.whl.
File metadata
- Download URL: sik_llms-0.3.26-py3-none-any.whl
- Upload date:
- Size: 40.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c87302c158fec69cbb237c0b63ced27032d7fb3a5fb3842629d16d6b113ceab
|
|
| MD5 |
32156010a4cf1c65a1d7501b6e5d50b6
|
|
| BLAKE2b-256 |
fc2cba7e077297371c1027145116dda169f4b909e761ccaa73a4046de3d2c322
|