Skip to main content

ninjaeval (Python)

Show NinjaEval what happens inside your AI bot (every tool call and LLM call), so it can grade them and show them side by side with production in its debugger. No dependencies.

import ninjaeval
ninjaeval.instrument()                     # records OpenAI, Anthropic and LiteLLM chat calls automatically

@ninjaeval.tool                            # records arguments, result or error, and duration
def get_order(order_id: str): ...

@app.post("/chat")
def chat(req):
    with ninjaeval.capture(req.headers) as run:     # active only for NinjaEval test requests
        reply = agent.run(req.message)
    return run.attach({"reply": reply})             # adds the "ninjaeval" block for tests, nothing otherwise
  • Tests only. NinjaEval marks its requests with X-NinjaEval-Test. Without that header, every hook does nothing and your response is unchanged.
  • Never breaks your app. Errors inside the SDK are swallowed, and your tools' own errors are recorded and re-raised as usual.
  • Redaction. capture(headers, redact=lambda text: mask_emails(text)) is applied to everything recorded.
  • Other clients: call ninjaeval.record_turn(model=..., messages_in=..., output=..., tool_calls=[...], prompt_tokens=..., completion_tokens=..., latency_ms=...) yourself.
  • OpenTelemetry (optional): with pip install "ninjaeval[otel]", each tool and LLM call is also a span, a child of the test's traceparent.
  • Works with sync and async code (FastAPI, Flask, Django, Starlette). Contract: the ninjaeval block v1.

Metadata

Release files for ninjaeval 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 ninjaeval 0.1.0
File Size Uploaded Provenance Actions
ninjaeval-0.1.0.tar.gz 7.9 kB With provenance Details for ninjaeval-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 15.0 kB

Release files / ninjaeval-0.1.0.tar.gz

Download URL ninjaeval-0.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2c52baeea4ee8f3f766faae51471a2c11ad4218ef6b31f7da4fdba120911ab65
BLAKE2b-256 checksum
How to use checksums
e2dc2f7d0413709aec825b8ca36230bf0ad84fc9ad8a84532003f0b76578ea4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

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

Download URL ninjaeval-0.1.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7066215a7a1ab38206509986474627c419f5c5d9ddc973d4e1088f0e54732db
BLAKE2b-256 checksum
How to use checksums
73d4664f9bdb55e16266719739cb097f2ec10a5c6ec35caaa2c3606f2d02acda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for ninjaeval 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ninjaeval-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

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 Full 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