Skip to content

rishabh0510rishabh/EnvForage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,546 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

EnvForge πŸ› οΈ

✨ Production-Grade ML Environment Provisioning Platform

EnvForge is an intelligent environment provisioning platform that automates one of the most frustrating parts of machine learning development: creating reliable and compatible development environments.

By combining hardware diagnostics, compatibility-aware version resolution, template-driven script generation, and built-in safety validation, EnvForge enables developers to generate deterministic setup scripts for PyTorch, TensorFlow, CUDA, YOLO, and other ML ecosystems across Windows, WSL, and Linux.

No more CUDA mismatches. No more dependency conflicts. No more hours spent debugging installation issues.

Generate. Verify. Deploy. Build AI with confidence.


Contributors

πŸ‘₯ A massive thank you to all the developers who have contributed code, resolved issues, and helped shape EnvForge into a production-grade ML environment provisioning platform!

Contributors Grid

Made with contrib.rocks.


πŸ“‘ Table of Contents


Project Overview

Deterministic logic > AI generation. Because scripts affect real systems, EnvForge relies on a strictly deterministic Compatibility Engine to resolve versions. It never guesses package versions or writes destructive shell commands.

EnvForge helps users:

  • πŸ”§ Generate environment setup scripts (setup.sh, setup.ps1, Dockerfile)
  • πŸ§ͺ Install compatible ML frameworks (TensorFlow, PyTorch, YOLO, etc.)
  • βœ… Verify existing environments
  • 🩺 Diagnose setup issues across OS, GPU, and Python boundaries

Features

  • Environment Profiles: Out-of-the-box configurations for pytorch-cuda, tf-gpu, yolov8, and more.
  • Hardware Introspection: A standalone CLI agent (envforge-agent) that detects OS, RAM, GPU, VRAM, and CUDA details without an internet connection.
  • Safety First: Every generated script passes through a regex-based SafetyFilter that strictly blocks dangerous commands (e.g., rm -rf /, mkfs).
  • Idempotent Setup: Scripts verify prerequisites before installing anything.
  • RESTful API: Fast, async backend built on FastAPI and PostgreSQL.

Architecture

πŸ—οΈ EnvForge is built with a modular, scalable architecture.

  1. CLI Diagnostic Agent: Inspects local hardware and emits a structured JSON DiagnosticReport.
  2. API Layer: FastAPI handles incoming requests and orchestrates logic.
  3. Compatibility Engine: A pure-Python module holding the "Engineering Moat" β€” the CUDA and Framework compatibility matrices.
  4. Template Engine: Renders Jinja2 templates (.sh, .ps1, Dockerfile) based on the resolved environment.
  5. Safety Filter: Scans rendered output to block destructive actions.
graph TD
    %% Styling definitions
    classDef component fill:#2374f7,stroke:#1055c4,stroke-width:2px,color:#fff;
    classDef data fill:#f9f9f9,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5,color:#000;
    classDef safety fill:#e63946,stroke:#b71c1c,stroke-width:2px,color:#fff;

    %% Nodes
    CLI["1. CLI Diagnostic Agent<br>(Local Hardware Inspection)"]:::component
    JSON["DiagnosticReport<br>(Structured JSON)"]:::data
    API["2. API Layer<br>(FastAPI Orchestration)"]:::component
    Engine["3. Compatibility Engine<br>(CUDA & Framework Matrices)"]:::component
    Template["4. Template Engine<br>(Jinja2: .sh, .ps**1**, Dockerfile)"]:::component
    Safety["5. Safety Filter<br>(Destructive Action Scan)"]:::safety
    Output["Safe Deployable Artifacts"]:::data

    %% Flow / Connections
    CLI -->|Emits| JSON
    JSON -->|Posts to| API
    API <-->|Consults| Engine
    API -->|Triggers| Template
    Template -->|Generates Raw Output| Safety
    Safety -->|Approves & Emits| Output
Loading

For more details, see ARCHITECTURE.md.


Project Structure

EnvForage/
β”œβ”€β”€ .github/                  # GitHub templates, workflows, and automation
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   β”œβ”€β”€ workflows/
β”‚   β”œβ”€β”€ CODEOWNERS
β”‚   β”œβ”€β”€ dependabot.yml
β”‚   └── PULL_REQUEST_TEMPLATE.md
β”‚
β”œβ”€β”€ backend/                  # FastAPI backend and compatibility engine
β”‚   β”œβ”€β”€ alembic/              # Database migrations
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ ai/               # AI troubleshooting logic
β”‚   β”‚   β”œβ”€β”€ api/              # API routes
β”‚   β”‚   β”œβ”€β”€ compatibility/    # CUDA/Framework compatibility engine
β”‚   β”‚   β”œβ”€β”€ core/             # Core application logic
β”‚   β”‚   β”œβ”€β”€ middleware/       # Custom middleware
β”‚   β”‚   β”œβ”€β”€ models/           # Database models
β”‚   β”‚   β”œβ”€β”€ schemas/          # Pydantic schemas
β”‚   β”‚   β”œβ”€β”€ services/         # Business services
β”‚   β”‚   └── templates/        # Script generation templates
β”‚   β”‚
β”‚   β”œβ”€β”€ scripts/              # Utility scripts
β”‚   β”œβ”€β”€ seeds/                # Compatibility matrices and profiles
β”‚   β”œβ”€β”€ tests/                # Unit, integration, and API tests
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── pyproject.toml
β”‚
β”œβ”€β”€ frontend/                 # Next.js web application
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ diagnose/     # Environment diagnostics UI
β”‚   β”‚   β”‚   β”œβ”€β”€ generate/     # Script generation UI
β”‚   β”‚   β”‚   β”œβ”€β”€ profiles/     # Environment profiles
β”‚   β”‚   β”‚   └── troubleshoot/ # AI troubleshooting interface
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable React components
β”‚   β”‚   β”œβ”€β”€ services/         # API communication layer
β”‚   β”‚   └── types/            # TypeScript types
β”‚   β”‚
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”‚
β”œβ”€β”€ cli/                      # Standalone diagnostic CLI agent
β”œβ”€β”€ docs/                     # Project documentation
β”‚
β”œβ”€β”€ docker-compose.yml        # Development environment
β”œβ”€β”€ docker-compose.prod.yml   # Production deployment
β”œβ”€β”€ CONTRIBUTING.md           # Contribution guidelines
β”œβ”€β”€ CODE_OF_CONDUCT.md        # Community standards
β”œβ”€β”€ SECURITY.md               # Security policy
β”œβ”€β”€ TROUBLESHOOTING.md        # Common issues & fixes
β”œβ”€β”€ CHANGELOG.md              # Release history
β”œβ”€β”€ LICENSE
└── README.md

Steps To Run

1. Install the CLI Agent

Inspect your environment without needing the backend!

pip install envforge-agent
envforge diagnose

2. Run the Backend (Docker)

git clone https://github.com/rishabh0510rishabh/EnvForage.git
cd EnvForage
docker-compose up -d

3. Run the Backend (Kubernetes)

Prerequisites:

  • Helm 3+
  • A running Kubernetes cluster (Docker Desktop, minikube, or cloud)
  • NGINX Ingress Controller (only if ingress.enabled=true):
  kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.0/deploy/static/provider/cloud/deploy.yaml
helm install envforge ./helm/envforge

# Enable ingress (optional)
helm install envforge ./helm/envforge \
  --set ingress.enabled=true \
  --set ingress.host=api.yourdomain.com

kubectl port-forward svc/envforge 8000:8000
kubectl port-forward svc/envforge-frontend 3000:3000

πŸš€ The API is now running at http://localhost:8000.

3. Generate a Script

Generate a PyTorch CUDA setup script for Linux:

curl -X POST http://localhost:8000/api/v1/scripts/generate \
  -H "Content-Type: application/json" \
  -d '{"profile_id": "pytorch-cuda", "target_os": "LINUX", "output_formats": ["setup.sh"]}'

Documentation Links

πŸ“š Document Purpose
ARCHITECTURE.md High-level system overview and component boundaries
COMPATIBILITY_ENGINE.md Core logic: CUDA mappings and framework rules
WORKFLOW.md Script generation, diagnosis, and repair flows
AI_USAGE_POLICY.md Where AI is allowed vs where deterministic logic is required
SCRIPT_SAFETY.md Prohibited commands and rollback philosophy
CLI_REFERENCE.md Commands for envforge diagnose, verify, and fix
API_DESIGN.md REST endpoints, schemas, and validation rules
PROFILE_SPEC.md How to build and define new ML profiles
TASKS.md The master implementation blueprint

Contributing

🀝 We love open source! Contributions of all sizes are welcome β€” whether it's fixing bugs, improving documentation, adding new environment profiles, enhancing the compatibility engine, or proposing new features.

Please read our Contributing Guide before getting started. You'll find detailed instructions for:

  • Local development setup (Docker & non-Docker workflows)
  • Backend, frontend, and CLI development
  • Branching and commit message conventions
  • Adding new profiles and script templates
  • Testing requirements and quality standards
  • Pull request guidelines and code review expectations

Before submitting a contribution, please ensure that all tests pass and relevant documentation is updated.

Thank you for helping make EnvForge more reliable, safe, and developer-friendly!


Roadmap

  • Phase 1: Core Backend (Compatibility Engine, Template Engine) βœ…
  • Phase 2: CLI Diagnostic Agent (envforge-agent) βœ…
  • Phase 3: Next.js Frontend Web App βœ…
  • Phase 4: AI Troubleshooting Layer βœ…
  • Phase 5: Environment Verification βœ…
  • Phase 6: Polish & Production Readiness βœ…

πŸ—ΊοΈ See the full ROADMAP.md for details.


License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors