Skip to main content

Generate environment maps (services, artifacts, env vars) for LLM decision-making

Project description

env2llm

AI Cost Tracking

PyPI Version Python License AI Cost Human Time Model

  • 🤖 LLM usage: $0.6013 (3 commits)
  • 👤 Human dev: ~$256 (2.6h @ $100/h, 30min dedup)

Generated on 2026-06-06 using openrouter/qwen/qwen3-coder-next


Generate environment maps for LLM agents: available services, commands, artifacts, masked environment variables, and runtime policies.

Default output is DOQL-flavored LESS (environment.doql.less), compatible with nlp2dsl examples:

environment[name="03-report-and-notify"] {
  NLP2DSL_BACKEND_URL: "http://localhost:8010";
  LLM_MODEL: "openrouter/...";
}

runtimes[0] { id: "orchestrator:nlp-service"; kind: "orchestrator"; ... }
commands[3] { name: "generate_report"; required: "report_type"; ... }

Install

cd env2llm
pip install -e ".[dev]"

CLI

# From an nlp2dsl example directory
env2llm /path/to/nlp2dsl/examples/03-report-and-notify

# Other formats
env2llm . --format yaml
env2llm . --format json
env2llm . --format markdown

Writes to .nlp2dsl/registry/environment.<ext> (and mirrors legacy paths for DOQL).

Python API

from env2llm import ensure_environment_map, render_format, generate_system_map

path = ensure_environment_map("examples/03-report-and-notify")
ir = generate_system_map("examples/03-report-and-notify", example_id="03-report-and-notify")
yaml_text = render_format(ir, "yaml")

Output formats

Format File Use case
doql.less environment.doql.less LLM + nlp2dsl orchestrator (default)
yaml environment.yaml Tooling, human edit
json environment.json APIs, CI
markdown environment.md Prompt injection summary

Environment variables

Variable Purpose
NLP2DSL_BACKEND_URL Gateway service URL
NLP2DSL_NLP_SERVICE_URL NLP orchestrator URL
NLP2DSL_WORKER_URL Worker executor URL
LLM_MODEL LLM provider/model id
ENV2LLM_CONTEXT Path to generated map (set after bootstrap)
NLP2DSL_DOQL_CONTEXT Alias for nlp2dsl compatibility

Secrets (*_KEY, *_TOKEN) are masked in output.

Extraction from nlp2dsl

This package contains the former nlp2dsl_sdk modules:

  • doql/ — parse/render runtime context
  • ir.pySystemMapIR schema (env2llm.system_map.v1)
  • generate.py, bridge.py, runtimes.py — introspection pipeline
  • registry.py — live registry refresh after workflow steps
  • policy/ — process and invoice policies from example-profiles.yaml

nlp2dsl can depend on env2llm and replace direct imports over time.

License

Licensed under Apache-2.0.

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

env2llm-0.1.3.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

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

env2llm-0.1.3-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file env2llm-0.1.3.tar.gz.

File metadata

  • Download URL: env2llm-0.1.3.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for env2llm-0.1.3.tar.gz
Algorithm Hash digest
SHA256 035daaefcf86b15da2c062d83d95fc3124aa1c1c821cb5bceb33a21e400a925b
MD5 c23d8663f95854a3690516d417f6bbb9
BLAKE2b-256 0f282d76d5875d6278327882e6a29ac4af59ec247157a963e98945c6719ebd67

See more details on using hashes here.

File details

Details for the file env2llm-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: env2llm-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 52.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for env2llm-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 69b62c96684e530871625bdf9b5f1c950c065a343ffcbc8cc7dec3c45869b593
MD5 396c331a7fdcf87342f89db2bfb11ee6
BLAKE2b-256 3af57b79d07c23d9c687fbcbeacd9a5f8175fc070cad429cc56a524671d3713e

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