Skip to main content

inlumen-agents

inLUMEN's pipeline design and code generation agents as one Python package, used by the inLUMEN backend, the codegen service and inlumen-bench. The design rationale is in inLUMEN's ADR 0005 (docs/adr/0005-design-and-codegen-libraries.md).

Module Contents Status
inlumen.contracts The pipeline graph model: port types, Parallel Map scopes, the artifact runtime, the Task package contract, step types, node ports and definitions, graph validation, subpipelines, plugins, Project JSON Done
inlumen.design The pipeline design agent (extra design) Done
inlumen.codegen The code generator (extra codegen) Done

Design a pipeline

from inlumen.design.run import design, openai_model_client

model = openai_model_client(
    "openai/gpt-4.1", base_url="https://openrouter.ai/api/v1", api_key=OPENROUTER_API_KEY,
)
result = await design("Read invoice PDFs, extract totals, save one CSV", model=model, name="Invoices")
result.accepted            # passed validation (after at most one repair round)
result.project             # inLUMEN Project JSON: opens with the canvas Import button
result.requests            # one record per model request: tokens, latency, outcome
result.catalog_fingerprint # what the agent could use, with the package version

It runs on an in-memory graph (inlumen.design.memory_store.InMemoryGraphStore), which behaves like the inLUMEN backend's Neo4j store: both run the scenarios in inlumen.design.store_contract, and a backend integration test requires identical results. Pass graph= to start from an existing canvas graph and catalog= to offer plugins or reusable pipelines.

Generate Task packages

from inlumen.codegen.run import generate, http_model
from inlumen.codegen.sandbox import DockerSandbox

model = http_model(
    "openai/gpt-5.2-codex", base_url="https://openrouter.ai/api/v1",
    api_key=OPENROUTER_API_KEY, provider="openrouter",
)
result = await generate(design_result.graph, model=model, files="data/")
result.accepted            # the generated pipeline passed integration validation
result.packages            # {flow_id: {filename: content}}: one Task package per step
result.write_packages("out/")
result.requests            # one record per model request: tokens, cost, latency

It runs the same planning, generation, repair and validation as the codegen service. sandbox defaults to NoSandbox() (static checks only); pass DockerSandbox() to run the pipeline on sample inputs, which needs a Docker daemon. files is a folder of attached files, looked up as <folder>/<flow_id>/<name> and then <folder>/<name>. runtime= overrides the runtime constraints for a fixed target environment, e.g. {"allowed_packages": [...], "network_allowed": False}. Any object with a name and an async complete(system_prompt=…, user_prompt=…, json_output=…, max_tokens=…) returning inlumen.codegen.model.ModelReply can be the model.

Install

The version in this folder is 1.0.0, the stable version that goes with inLUMEN 1.0.0 (tag v1.0.0, released on 2026-11-29). It is not on PyPI; install it from the tag:

pip install "inlumen-agents[design,codegen] @ git+https://github.com/DATAPACT/inLUMEN@v1.0.0#subdirectory=packages/agents"

PyPI has only development builds of an earlier version, up to 1.0.0b6.dev6; do not use them for 1.0.0. Extras: design for inlumen.design, codegen for inlumen.codegen; inlumen.contracts needs neither.

In the inLUMEN repository (editable, for development):

uv pip install -e "packages/agents[design,codegen]"

Stability

This section is part of what inLUMEN 1.x keeps stable; see the support and versioning policy.

Public. The public API is the names listed in __all__ of the modules below, the contract files, and the versions they carry. tests/test_public_api.py pins the names, the signatures of the documented entry points (a new optional parameter passes, a removal or a new required parameter fails) and the GraphStore methods (compared exactly); changes are listed in the changelog.

Module Public names (see __all__)
inlumen.contracts artifact_runtime_source, package_version
inlumen.contracts.port_types, map_scope, step_types, node_ports, node_definitions, pipeline_graph_validation, subpipeline_reference, artifact_runtime, task_package_contract, plugin_manifest, plugins, project_ir the names in each module's __all__
inlumen.design.run design, openai_model_client, DesignResult
inlumen.design.memory_store, store, store_contract, catalog, team, turn InMemoryGraphStore; GraphStore and its argument types; SCENARIOS, observe; Catalog; build_design_team; run_design_turn, DesignTurn
inlumen.codegen.run generate, http_model, CodegenResult, ModelClient, DockerSandbox, NoSandbox
inlumen.codegen.model, sandbox ModelClient, ModelReply; DockerSandbox, NoSandbox, Sandbox, cancel_sandbox_run
Contract file Version
inlumen/contracts/port_types.json (port types and connection rules) version: 1
inlumen/contracts/task_package_spec.json (Task package) urn:inlumen:task-package:1
inlumen/contracts/plugin-manifest.schema.json (plugin manifest) inlumen.plugin@1
inlumen/contracts/node_definitions/node-definition.schema.json and manifests/core.json (node definitions) each definition carries its own version
Artifact runtime (artifact_runtime.CONTRACT_ID) inlumen.generic-node@2
Project JSON (project_ir.PROJECT_IR_SCHEMA_VERSION) inlumen.project@2

Not public. Names that start with an underscore, names that a module does not list in __all__, and modules not listed above (for example inlumen.design.context, tools, guardrails, fast_edit, from_code, inlumen.codegen.generator, schemas, llm, and inlumen.llm_requests). The inLUMEN backend and codegen service use some of them, for example artifact_runtime.atomic_json, task_package_contract.safe_path and design.store.returned_no_rows; they are released with the package and may change in any release. The package __init__ files re-export nothing, so import inlumen and inlumen.contracts need no extra.

Changes in 1.x. A minor release only adds: new modules, new names, new optional parameters with a default, and new optional fields. A removal or an incompatible change is announced in the changelog, and the name is marked as deprecated, at least one minor release before it is made; it is then made in the next major release. Any change to the methods of the GraphStore protocol, including a new method or a new optional parameter, counts as an incompatible change, because every store must implement it.

Tests

cd packages/agents && uv run --extra design --extra codegen --extra dev pytest

OpenAI request compatibility

Chat and code generation share model capability handling. For direct OpenAI endpoints, GPT-5.5 uses Chat Completions with max_completion_tokens; GPT-6 models and Codex/Pro models automatically use Responses with max_output_tokens. The design client translates function calls and results, replays reasoning items during tool loops, and disables provider-side response storage. Its streaming interface yields one complete result.

Request configuration accepts api_format (auto, chat_completions, or responses) and reasoning_effort. Incompatible known model/format combinations are rejected before sending a request. Sampling parameters (temperature, top_p) are omitted for recognized reasoning models unless effort is none. OpenRouter, Ollama, and custom compatible endpoints retain their existing Chat Completions defaults; Responses is available through an explicit format override. Unknown model names remain subject to provider validation and account access.

Provider failures retain their HTTP status and useful error message. Credentials are redacted; arbitrary internal exceptions still produce a generic chat error. The compatibility tests use simulated provider responses and make no paid calls. Model rules follow the OpenAI model guide and GPT-5.5 model reference.

Metadata

Release files for inlumen-agents 1.0.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 inlumen-agents 1.0.0
File Size Uploaded Provenance Actions
inlumen_agents-1.0.0.tar.gz 335.0 kB Without provenance Details for inlumen_agents-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inlumen-agents 1.0.0
File Interpreter ABI Platform Actions
inlumen_agents-1.0.0-py3-none-any.whl Python 3 none any Details for inlumen_agents-1.0.0-py3-none-any.whl

Total release size: 647.2 kB

Release files / inlumen_agents-1.0.0.tar.gz

Download URL inlumen_agents-1.0.0.tar.gz
Size 335.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a8ee4f1e10907e5ec844b03c90a6918bb5b1654d1eab10323cabeb87606e893e
BLAKE2b-256 checksum
How to use checksums
d3a0f78c301ba312a5fd4819ec209661c1dcaba03efa234c1e09177d526f3853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / inlumen_agents-1.0.0-py3-none-any.whl

Download URL inlumen_agents-1.0.0-py3-none-any.whl
Size 312.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97b741fa264456cfd1a1343d715d52279ba86a6fb4eecfdd7f5fb550a776a6e0
BLAKE2b-256 checksum
How to use checksums
50f1a67098bf5f79a53326fd882df0fabcfc3ab8217a7e96a509ad1a1fe66c26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for inlumen-agents 1.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.

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.

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