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-latest'
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.21.tar.gz
(160.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
sik_llms-0.3.21-py3-none-any.whl
(40.5 kB
view details)
File details
Details for the file sik_llms-0.3.21.tar.gz.
File metadata
- Download URL: sik_llms-0.3.21.tar.gz
- Upload date:
- Size: 160.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf9af110ddc96c09d2fabae32b6619abc0d2a0dd2b5f003bf7359c903db22238
|
|
| MD5 |
73a41b8f6b0321d6c711ca365b1a147b
|
|
| BLAKE2b-256 |
053b61656e9b06280914dd3fbc08b64c7d269c9bd7573f37ad9c2a193b061639
|
File details
Details for the file sik_llms-0.3.21-py3-none-any.whl.
File metadata
- Download URL: sik_llms-0.3.21-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
766cb2d541ab7dc7d0ebc6a4e2c3bea0e42946d46235a713bd436f424a9c5f1a
|
|
| MD5 |
1ed5a2205958c7268c40992492670ef3
|
|
| BLAKE2b-256 |
363f62850a209fd3e4b6b660f442226e67722f64930748ac9401a5aba4986811
|