Skip to main content

nolma

AI gateway SDK — cost control, session tracing, and security for LLM agents.

One URL change. See every dollar your AI agents spend.

Installation

pip install nolma

Quick start

from nolma import Nolma

nolma = Nolma(api_key="nm_live_abc123")

@nolma.session(name="support-bot", user_id="user_42")
async def my_agent(query: str):
    # Your LLM calls go here — Nolma tracks everything
    ...

Session decorator

Wraps your agent function with automatic session tracking via contextvars:

@nolma.session(name="research-agent", user_id="user_123")
async def research(topic: str):
    result = await llm_call(topic)
    return result

Context manager

async with nolma.start_session(name="email-drafter") as ctx:
    print(ctx.session_id)  # sess_abc123...
    result = await draft_email(input)

Header injection

Pass Nolma headers to any LLM SDK:

import anthropic

client = anthropic.Anthropic(
    base_url=nolma.gateway_url + "/anthropic",
    default_headers=nolma.get_headers(),
)

Signals (Nolma Lens)

Track what users do with LLM outputs:

nolma.signal(session_id, action="accepted")
nolma.signal(session_id, action="edited", edit_distance=42)
nolma.signal(session_id, action="regenerated")

Context scanning (Nolma Shield)

Detect injection attacks in RAG content:

result = await nolma.scan_context(
    content=retrieved_doc,
    source="rag",
    agent="support-bot",
)
if result["decision"] == "BLOCK":
    raise SecurityError("Injection detected")

Documentation

Full docs at docs.nolma.ai

License

MIT

Metadata

Release files for nolma 0.1.0

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

Source distribution (sdist)

Source distribution for nolma 0.1.0
File Size Uploaded Provenance Actions
nolma-0.1.0.tar.gz 5.7 kB Without provenance Details for nolma-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.4 kB

Release files / nolma-0.1.0.tar.gz

Download URL nolma-0.1.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a8af2cdeb25127c38152520242646325ce958862fb59b28efa451f0066859b90
BLAKE2b-256 checksum
How to use checksums
8d905ceb5cc8bf8ee45bd108515d40a084e50fd238e2e410dec5039cd4bf7ea3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / nolma-0.1.0-py3-none-any.whl

Download URL nolma-0.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29a51c4c01377ea80212f76173c7ddd19792cd48fd9ad6e70f81f76d3581785f
BLAKE2b-256 checksum
How to use checksums
db52c7b43ab9ff56597160d5f160b6b9ed2028d61e34eed4213e2965476dca8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for nolma 0.1.0

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.0 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