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.22.tar.gz (160.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.22-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sik_llms-0.3.22.tar.gz
Algorithm Hash digest
SHA256 13f927db84eff4f7439865b3bcb7615911ba9bef7f3b40cbe6bb39a831dc0217
MD5 d67f186d4bdae8af92c641184efe9377
BLAKE2b-256 0673ef246df20f610e75a84d0c7c7a1849f9007e91fdeb05c14dabf30bfeea04

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sik_llms-0.3.22-py3-none-any.whl
Algorithm Hash digest
SHA256 c65bdf6d7e7f615439ec82204fee80e999cb5b604617dddd40e1afd1687e7047
MD5 7e42927bd6bcad875a5cd94d98cee9c7
BLAKE2b-256 cf469b2181e250bc0a5e22881cafc4d33c4ef6471888c7e772a688abc7396a9d

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