Skip to main content

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


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.32.tar.gz (167.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sik_llms-0.3.32-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file sik_llms-0.3.32.tar.gz.

File metadata

  • Download URL: sik_llms-0.3.32.tar.gz
  • Upload date:
  • Size: 167.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for sik_llms-0.3.32.tar.gz
Algorithm Hash digest
SHA256 356a61a16b652587d3caa803f7585655214036dab19b749cb5278ec5a20abb9b
MD5 5e378af437473a38d41cd8cb235ea6a8
BLAKE2b-256 54399788fa9f8d4c4021c5cdb91757cbd17cd6106ca8b5a08f526d71e6f114d4

See more details on using hashes here.

File details

Details for the file sik_llms-0.3.32-py3-none-any.whl.

File metadata

  • Download URL: sik_llms-0.3.32-py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for sik_llms-0.3.32-py3-none-any.whl
Algorithm Hash digest
SHA256 0ed83452fc3b243831a4fd44a904d0df86cc5135d3c349a3d5aea22513c98ec2
MD5 7c0b618490f443795ee9d54d02dad365
BLAKE2b-256 191031c811e975b2a665dbfcfcb78a3df9f1f5c09dc182f9e6cf5a0e6e56efee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page