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.0203 (1 commits)
  • 👤 Human dev: ~$200 (2.0h @ $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.1.tar.gz (45.0 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.1-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: env2llm-0.1.1.tar.gz
  • Upload date:
  • Size: 45.0 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.1.tar.gz
Algorithm Hash digest
SHA256 b7d1f5c5c7c33eff9dc8563558a2bfc152ca730b326e6d55c2f989b539a98b06
MD5 b68ed6aff97c15847a163af8619e79a0
BLAKE2b-256 194f547c4fa969a64eb5f4613733a0994c84beba78b6e8c4a976af3b59c52165

See more details on using hashes here.

File details

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

File metadata

  • Download URL: env2llm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 52.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a10ed6c532a2e3275f0b4a504b9b9f347a5243b4831783f0a2f7d7a145e3e87
MD5 0af5bb631ee74d49245666d3db1c08c6
BLAKE2b-256 1106d4afb297647e905903192e5bf30e0b12ff035daa33331b3dcbb35c308a6c

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