Skip to main content

llmsays

One-line LLM calls with automatic prompt-tier routing and provider failover.

llmsays keeps usage simple:

from llmsays import llmsays

response = llmsays("Explain quantum tunneling in simple words")
print(response)

Why llmsays

  • Single function API: llmsays(prompt)
  • Smart routing with sentence-transformers/paraphrase-MiniLM-L3-v2
  • Tier selection: small, medium, large, extra_large
  • Provider failover: Groq, NIM, OpenRouter, Fireworks, Baseten
  • Latency-aware provider ordering
  • Optional parallel provider querying for faster first-response

Installation

pip install llmsays

Required Environment Variables

Set at least one provider key (multiple keys recommended for failover):

  • GROQ_API_KEY
  • OPENROUTER_API_KEY
  • NVIDIA_API_KEY
  • FIREWORKSAI_API_KEY
  • BASETEN_API_KEY

Example:

export GROQ_API_KEY="your_key"
export OPENROUTER_API_KEY="your_key"

Quick Start

from llmsays import llmsays

user_prompt = input("Here goes your prompt: ")
print(llmsays(user_prompt))

Advanced Usage

Choose provider order:

from llmsays import llmsays

print(
	llmsays(
		"Analyze this legal clause",
		provider_preference=["Groq", "Openrouter", "fireworks-ai"],
	)
)

Enable parallel provider queries (returns first successful response):

from llmsays import llmsays

print(
	llmsays(
		"Design a production-ready architecture with tradeoffs",
		use_multiprocessing=True,
	)
)

CLI Usage

llmsays "Explain transformers in simple terms"
llmsays "Analyze this legal clause" --providers Groq Openrouter
llmsays "Summarize this API contract" --use-multiprocessing

How Routing Works

  1. Heuristic pre-filter estimates complexity quickly.
  2. Semantic routing refines tier selection.
  3. Selected tier maps to provider-specific model choices.
  4. If one provider fails, the next provider is attempted automatically.

Notes

  • Requires Python >=3.9
  • Internet connection is required to call provider APIs
  • Responses depend on the configured provider/model availability

License

MIT

Metadata

Release files for llmsays 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llmsays 0.1.3
File Size Uploaded
llmsays-0.1.3.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llmsays 0.1.3
File Interpreter ABI Platform
llmsays-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / llmsays-0.1.3.tar.gz

Download URL llmsays-0.1.3.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dc751c6c68f601684f0b274b8472e8a2d4f2ff0ff784fa09aed676b3b828359b
BLAKE2b-256 checksum
How to use checksums
13cf26e423d185238ed5fea2cfba51476da76096697bcd0bd39112142402b751
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / llmsays-0.1.3-py3-none-any.whl

Download URL llmsays-0.1.3-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ac25cdec163e61d2ce0a116b411261eb34a9e97bcf388b1f5706a0b09a3f3ca
BLAKE2b-256 checksum
How to use checksums
6723dfca7e4d5297c5096843b9c62b79f16020ecd5c7d825e7c0bce005a1b36e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page