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.3.tar.gz
(82.3 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.3-py3-none-any.whl
(31.3 kB
view details)
File details
Details for the file sik_llms-0.3.3.tar.gz.
File metadata
- Download URL: sik_llms-0.3.3.tar.gz
- Upload date:
- Size: 82.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b01b44797f8301cdf3a0cc0fdc67f20ecf6547a38eda9830f5816d457bdc3c50
|
|
| MD5 |
60f3d54354a9eae10cd15ce090927601
|
|
| BLAKE2b-256 |
0649c2fa05a4a6b73c81663a07d66cd5c5ba48476614bf020d09e551a4409516
|
File details
Details for the file sik_llms-0.3.3-py3-none-any.whl.
File metadata
- Download URL: sik_llms-0.3.3-py3-none-any.whl
- Upload date:
- Size: 31.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
652fd261b7dee49486460a1d7415f165a7e541b3d93f5fd0e114898329369a0e
|
|
| MD5 |
5be20ba827d61626244712d9a5177f1e
|
|
| BLAKE2b-256 |
d8ebb4095331d0fe60b7480065092645df800878e62195dbd02438d0b786b774
|