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-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


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.8.tar.gz (95.4 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.8-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sik_llms-0.3.8.tar.gz
Algorithm Hash digest
SHA256 ebe6db2dee25a55f008686ae052fd678d76acb6d3a9d7a29e10f711595079cd5
MD5 270fa38e5937f9c8982ba3a3a1858d7c
BLAKE2b-256 2d7f5b51a46daac769d122e7a3e17a425c7b01847de960b4d7e859fec7b5cec4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sik_llms-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2d371f58f7a360b2aded418d97c5971733c09a0f11756693a3410b712eef5d
MD5 cb5eeaff3f9cecc0810eb067641cfc50
BLAKE2b-256 0b5915598c0eade415e5bd2164ea907f523853aa4813bc8b7efa78b6bb63f527

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