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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sik_llms-0.3.20.tar.gz
Algorithm Hash digest
SHA256 c063ef4d98f5f4668e71dae96e0754b9e729a62d8f7d9b20080ec669ed0492e1
MD5 71e585e43c714d050a77ed8387269c05
BLAKE2b-256 46dd17f66d39aba537ee05d839a07ef36e83d9f5cff3ec7999599910e7146cf0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sik_llms-0.3.20-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

Hashes for sik_llms-0.3.20-py3-none-any.whl
Algorithm Hash digest
SHA256 b23732331ffce0f3e03ba7a0357fd7f74f83b53bb23b1307e7492e235c0fe8c2
MD5 5c7c5aacb1d0430be66cfcdb3b2ef443
BLAKE2b-256 2094df5a2f87b12e34ddde493967ac0f5a1027c9c51aaeb951d52b800272a7f7

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