Skip to main content

emberlm

Official Python SDK for EmberLM. Run versioned prompts from your production code, evaluate LLM responses, and ship AI with confidence.

Install

pip install emberlm

Requires Python 3.8+. Zero third-party dependencies.

Quick start

Get an API key from Settings → API Keys in the dashboard. Keys start with pk_live_.

from emberlm import Client

client = Client(api_key="pk_live_...")

result = client.run(
    "summarize_docs",
    variables={"document": doc_text},
)

print(result["text"])
print("passed_evals:", result["passed_evals"])
print("confidence:", result["confidence"])
print("cost_usd:", result["cost_usd"])
print("latency_ms:", result["latency_ms"])

API

Client(api_key, base_url=..., timeout=60)

client = Client(
    api_key="pk_live_...",
    base_url="https://emberlm.dev",  # optional
    timeout=60,                        # optional, seconds
)

client.list_prompts()

List every prompt in the API key's workspace.

data = client.list_prompts()
for p in data["prompts"]:
    print(p["name"], p["current_version"])

client.get_prompt(name)

Fetch a single prompt by name. Returns the prod-tagged version if one exists, otherwise the latest.

prompt = client.get_prompt("summarize_docs")
print(prompt["system_prompt"], prompt["user_prompt"])

client.run(prompt_name, variables=None, model=None)

Run a saved prompt. Variables are substituted into {{placeholders}}. All workspace eval rules are applied to the output. The run is persisted and counts toward the workspace's analytics.

result = client.run(
    "classify_ticket",
    variables={"body": ticket_body},
    model="claude-haiku-4-5",  # optional override
)

# result keys:
#   run_id, prompt, version, model,
#   text,
#   input_tokens, output_tokens, total_tokens,
#   cost_usd, latency_ms,
#   passed_evals, confidence, evals,
#   error

client.eval(response, rule_ids=None, prompt=None, variables=None)

Evaluate an arbitrary response against the workspace's active eval rules. Useful when the response was generated by a different SDK or model.

result = client.eval(
    response=llm_response,
    prompt=user_prompt,            # optional
    variables={"name": "Jane"},    # optional
    rule_ids=["rule-id-1"],        # optional, defaults to all active
)
print(result["passed"], result["confidence"])

An alias client.evaluate(...) is also available for users who prefer to avoid the eval name.

Errors

Any non-2xx response raises EmberLMError:

from emberlm import Client, EmberLMError

try:
    client.run("missing_prompt")
except EmberLMError as e:
    print(e.status, str(e))
Status Meaning
401 Missing or invalid API key
403 API key's plan does not permit the SDK
404 Prompt not found in the workspace
429 Monthly call limit reached, or rate limited

Rate limits

100 requests / minute per API key.

License

MIT

Metadata

Release files for emberlm 0.1.1

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

Source distribution (sdist)

Source distribution for emberlm 0.1.1
File Size Uploaded Provenance Actions
emberlm-0.1.1.tar.gz 5.4 kB Without provenance Details for emberlm-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 11.1 kB

Release files / emberlm-0.1.1.tar.gz

Download URL emberlm-0.1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4eae968c9b54616a45cd6eb5d389fcd4a5540e707678bfdcfd955db153448547
BLAKE2b-256 checksum
How to use checksums
4179643869a8fd3a2de1726ed221f03aa888b129de8fe2e96d560418ec465bd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / emberlm-0.1.1-py3-none-any.whl

Download URL emberlm-0.1.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c41616c7fce37cd73b06a961a61598e3b8b4631f7ddd3c073eab27a55d845b4b
BLAKE2b-256 checksum
How to use checksums
8b681adbb89b9fd496093c3d40ae61a36a6ae4ba447ee44a68a27ebbd75cb679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for emberlm 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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