Skip to main content

Python runtime core for NemoIR — execute compiled agent workflows as structured state machines with tool orchestration, policy enforcement, model-backed stage execution, and live event streaming.

Project description

NemoIR Runtime

Python runtime core for NemoIR — an LLVM-inspired compiler stack for agentic workflows.

Executes compiled agent workflows as structured state machines with tool orchestration, policy enforcement, model-backed stage execution (via LiteLLM), and live event streaming.

Features

  • Workflow runtime — state-machine execution with stage ordering, read/write resolution, transition selection, and run limits.
  • Tool framework — capability-based tool registration, catalog-driven parameter validation, and policy-gated invocation (fs.read, fs.write, user.confirm, os.shell, user.elicit).
  • Policy engine — deny and before-policies with expression evaluation (e.g., path containment guards).
  • Model integrationModelStageExecutor with LiteLLM adapter, structured output enforcement, tool-call loop, ModelRouter for per-stage model routing, and optional streaming via ModelStreamingAdapter.
  • Live event streamingWorkflowRuntime.stream() / generated Agent.stream() async iterator emitting WorkflowEvent values (run lifecycle, model deltas, tool calls, policy decisions) for UIs, debugging, and observability.
  • Compiler backend target — generated workflow-specific Python packages consume this runtime; see nemoir-backend-python in the main NemoIR repo.

Install

pip install nemoir-runtime

Quick start

import asyncio
from pathlib import Path
from nemoir_runtime import WorkflowRuntime, WorkflowManifest, Tool, ToolContext, ToolRegistry

# Define tools
async def read_file(*, path: Path, ctx: ToolContext) -> str:
    return Path(path).read_text()

tools = ToolRegistry([
    Tool(name="read_file", capability="fs.read", description="Read a file",
         input_schema={"path": Path}, handler=read_file),
])

# Load a manifest (typically generated by the NemoIR compiler)
manifest = WorkflowManifest(...)

runtime = WorkflowRuntime(manifest=manifest, tools=tools, stage_executor=my_executor)
result = await runtime.run({"task": "analyze code"})
print(result.output)

See the NemoIR project for the full compiler workflow (DSL → IR → generated package).

Requirements

  • Python ≥ 3.11
  • LiteLLM ≥ 1.0.0 (for LiteLLMModelAdapter; custom ModelAdapter implementations can avoid this dependency)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nemoir_runtime-0.1.0.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nemoir_runtime-0.1.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file nemoir_runtime-0.1.0.tar.gz.

File metadata

  • Download URL: nemoir_runtime-0.1.0.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for nemoir_runtime-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e695deca780eec6621865db813f9eded5d552b57a64e428e416d685f95de0f80
MD5 da7ad12a613e86827deec45d22e87178
BLAKE2b-256 80ece8ce9fed416c69773f89cd144cae0b29e8384cf198a4194e95481dc64718

See more details on using hashes here.

File details

Details for the file nemoir_runtime-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nemoir_runtime-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for nemoir_runtime-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cac64583f0ea1e093b6af4cdba9bc72a42d52342fe2aae189f07d4f2a860ee45
MD5 a06af01989a06b67d55990fcdb731fea
BLAKE2b-256 1fbc609c0c92c35ae182def1392b376efaf347c2857fa481c9f8b5c6f817718f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page