Stats
Actions
Tags
From liter-llm
Sends chat completions via liter-llm with provider/model routing. Covers call shape, provider selection, model_hint, message roles, and error categories.
How this skill is triggered — by the user, by Claude, or both
Slash command
/liter-llm:calling-llmsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Send a chat completion with `client.chat(...)`. The model string is
Send a chat completion with client.chat(...). The model string is
provider/model; the prefix selects the backend.
import asyncio, os
from liter_llm import LlmClient
async def main() -> None:
client = LlmClient(api_key=os.environ["OPENAI_API_KEY"])
response = await client.chat(
model="openai/gpt-4o",
messages=[
{"role": "system", "content": "You are concise."},
{"role": "user", "content": "Name three Rust crates for HTTP."},
],
)
print(response.choices[0].message.content)
asyncio.run(main())
await client.chat(model="anthropic/claude-sonnet-4-20250514", messages=[...])
await client.chat(model="google/gemini-2.0-flash", messages=[...])
await client.chat(model="groq/llama3-70b", messages=[...])
await client.chat(model="mistral/mistral-large-latest", messages=[...])
await client.chat(model="bedrock/anthropic.claude-v2", messages=[...])
Set model_hint at construction to drop the prefix on every call:
client = LlmClient(api_key="sk-...", model_hint="openai")
await client.chat(model="gpt-4o", messages=[...]) # routes to OpenAI
OPENAI_API_KEY, ANTHROPIC_API_KEY, …); never
hardcode them.model_hint, routing fails.Authentication, RateLimited, BadRequest,
ContextWindowExceeded, ContentPolicy, NotFound, Server,
ServiceUnavailable, Timeout, BudgetExceeded.npx claudepluginhub xberg-io/plugins --plugin liter-llmCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.