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.5991 (2 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.2.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.2-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: env2llm-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 72d9917b6afe018f345e47dbe3731bc6ad7c858e923c40ca7bf43bdfc666b78b
MD5 14d99be75627e621bc020863ed8b76b5
BLAKE2b-256 9aa180e14b0a197587f5deb7bbbf7b86b8f8ab008abfa06a7e50eb7e4f786c6e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: env2llm-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 db6cbbf04fb7f094f0132563437fef3b23b7d8bce7f48a3591e70105b04a2c53
MD5 5b6551b02becdd5617986041776b8f8f
BLAKE2b-256 c5c733e1657d69f24aa0cd85156232a7007f5d0de784193a5c01ef273aad8a6e

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