NeoMundi Python SDK 2
Version 2.0.0 — REST and SSE implemented. Pilot evaluation.
Integrate NeoMundi measurements into your infrastructure, or explore Station. Check Station's current access and availability; its dashboard evolves separately. Understand the measurements · Data flows and confidentiality
Where we stand
The V2 development work is complete and merged into main. Both REST and SSE are available in the SDK source.
| Step | Status |
|---|---|
| REST and SSE implementation | Complete |
| Offline regression suite | Passing in GitHub CI; historical capture skips are tracked separately |
| CI | Passed on Python 3.9, 3.11, 3.12 and 3.13 |
| Live REST and SSE qualification using the installed V2 SDK | Both passed on 2026-11-13; see evidence limits below |
On 2026-11-13 an installed wheel was tested against the deployed API: one REST observation (complete, coverage 1.0, five measured signals) and one SSE generation (seven events, terminal done, verified integrity). The full operator report and request identifiers remain private. The two public REST/SSE versioned JSON schemas were subsequently compared byte-for-byte against the deployed API via GitHub Actions. These checks establish transport success and schema parity at that time, not scientific validity, all providers or a genuine degraded 3.5.0 capture. See 3.5.0 compatibility scope. Publication and Station integration are separate steps.
Choose the right path
| Your need | Method | API route |
|---|---|---|
| Measure an execution you already produced | client.govern(...) |
POST /v1/govern |
| Generate an answer through the API and receive live checks | client.stream(...) |
POST /v1/govern/stream |
These routes have different request bodies and result envelopes. SSE is not a subscription to REST results. The synchronous Python client supports both; an async/await client is not part of this release.
NeoMundi provides measurements and their provenance, including unavailable measurements. Interpretation and execution authority remain with your application. The SDK does not add decision thresholds or replace null with zero.
Install
Python 3.9+; httpx is the only runtime dependency. Not published on PyPI. The proposed distribution name is neomundi (subject to approval and availability), while Python imports remain import neomundi.
The SDK code is licensed under Apache-2.0, subject to contributor-rights review; see the licensing boundaries. The hosted Runtime Measurement API remains proprietary and commercially metered (authorised key, applicable credits/quotas and service terms). An open-source SDK does not include free hosted API access.
git clone https://github.com/neomundi-io/neomundi-python-sdk.git
cd neomundi-python-sdk
python -m pip install .
# Or install a locally built package:
python -m pip install dist/neomundi-2.0.0-py3-none-any.whl
No API or provider credentials are included, read automatically or persisted.
Select the API environment explicitly through base_url.
REST: measure an existing execution
import os
from neomundi import NeoMundiClient
with NeoMundiClient(
api_key=os.environ["NEOMUNDI_API_KEY"],
base_url=os.environ["NEOMUNDI_BASE_URL"],
) as client:
result = client.govern(
token_count=128, # actual observed usage
latency_ms=842.0, # actual measured latency
llm_prompt="What is the capital of France?",
llm_response="Paris.",
)
print(result.request_id, result.format_score("g_score"))
This call submits an existing answer; it does not generate one. Sending only metrics remains possible, but does not establish that semantic checks were performed. Optional fields left as None are omitted, not silently set to zero.
SSE: receive an answer and checks live
import os
from neomundi import NeoMundiClient, StreamError
with NeoMundiClient(
api_key=os.environ["NEOMUNDI_API_KEY"],
base_url=os.environ["NEOMUNDI_BASE_URL"],
) as client:
try:
with client.stream(
prompt="Explain the chosen topic.",
model=os.environ["LLM_MODEL"],
provider=os.environ["LLM_PROVIDER"],
provider_api_key=os.environ["LLM_PROVIDER_API_KEY"],
max_tokens=256,
) as stream:
for event in stream:
if event.event == "chunk":
print(event.content, end="", flush=True)
result = stream.result
assert result is not None
print(result.request_id, result.integrity_verified)
except StreamError as error:
print(type(error).__name__) # no automatic retry
The streaming API receives the provider key in its JSON body and calls the selected provider. This can incur provider cost and a NeoMundi quota charge. The SDK does not select OpenAI or any model by default.
Use with to close early when needed. done.response_text repeats the whole
answer: do not append it to chunks. The SDK verifies assembly and supplied
length/byte/hash metadata. Errors after HTTP 200, missing terminal events and
truncated streams fail explicitly. No stream is reconnected or retried,
including when REST retries were explicitly enabled.
Verification and limits
The V2 streaming contract is derived from inspected backend source at
aeff13c; tests use synthetic, fragmented streams with a mock transport.
A bounded hosted SDK REST and SSE qualification was carried out on
2026-11-13; see the exact evidence scope in
the compatibility assessment.
It does not certify all providers, degraded paths or scientific comparability.
The SSE StreamResult preserves its own raw envelope; it is not cast into
REST GovernResult. A complete transport can carry an incomplete measurement.
Integrity checks do not establish scientific validity. The SDK does not repair
backend metric, trajectory, quota or evaluator defects.
Documentation
- SSE lifecycle, errors, integrity and limits · Français
- Migration from v0.1
- Audit and repairs delivered
- Verification results and live qualification status
- Known backend and SDK limitations · Français
- REST pilot guide · Français
- Inspected REST contract · Measurement limits
- Offline SSE example
python -m pip install -e ".[dev]"
python -m pytest tests
python examples/04_streaming_sse.py
python -m build
SDK version 2.0.0 is a client release, not measurement version 2.0.0. Check the measurement version actually returned by your deployment before comparing observations.
Metadata
Release files for neomundi 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neomundi-2.0.0.tar.gz | 145.9 kB | With provenance | Details for neomundi-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neomundi-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for neomundi-2.0.0-py3-none-any.whl |
Total release size: 191.5 kB
Release files / neomundi-2.0.0.tar.gz
| Download URL | neomundi-2.0.0.tar.gz |
|---|---|
| Size | 145.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67778d7a3e94868863c3a051be94c15d1f036e51cf4bcb8a0b02a8fdba9b6f0d
|
|
BLAKE2b-256 checksum How to use checksums |
c272a05c2b5efc5da59711004c1fac5b6b9b705510c13389781224313db91ccf
|
| 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 Nov 14, 2026.
Transparency logRelease files / neomundi-2.0.0-py3-none-any.whl
| Download URL | neomundi-2.0.0-py3-none-any.whl |
|---|---|
| Size | 45.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8eae5cd52c3b91b55377881177bc480af6097f21fc1a79e67d6140066b9abcf
|
|
BLAKE2b-256 checksum How to use checksums |
b22b867b82f3ae637807ca9f80aed5d1048cfbb1d9f225ed84011bfa2fc876e0
|
| 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 Nov 14, 2026.
Transparency logSecurity for neomundi 2.0.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
Both files in this release have been uploaded with provenance metadata.
Attestation for neomundi-2.0.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 Nov 14, 2026.
Transparency logA 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.