EXPERIMENTAL — This plugin is a work in progress. APIs, features, and UI may change without notice. External links and documentation may become outdated or broken.
Model Forge is a QGIS plugin that generates editable geoprocessing models from plain-language descriptions. It bridges AI language models with QGIS Processing Framework, transforming natural language workflow descriptions into visual models ready for editing, refinement, and execution.
| Generate Tab | Model Tab | Settings Tab | History Tab |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| Generated Result |
|---|
![]() |
User Description --> LLM Backend --> QGIS Processing Model
(e.g. "Buffer (OpenAI, (.model3 file,
then clip...") Ollama, any editable in Designer)
OpenAI-compatible)
- Natural language to model — Describe workflows like "Buffer input points by 500m, clip with city boundary, compute mean population"
- Multi-LLM support — Works with any OpenAI-compatible API (OpenAI, Ollama, Anthropic, local models, custom endpoints). Not locked to a single provider unlike IntelliGeo
- Visual model generation — Opens directly in QGIS Model Designer with pre-computed layouts
- Iterative refinement — Use repair prompts to fix or extend generated models
- Layout algorithms — Sugiyama, topological, axis pack, radial shell, ancestor weighted
- External links may become outdated or broken
- Experimental features may change without notice
- Generated model quality depends on LLM capability
- Custom step registration does not persist across sessions
- Install via QGIS Plugin Manager (Plugins -> Manage and Install Plugins -> search "Model Forge")
- Open panel: Plugins -> Model Forge -> Open Model Forge
- Configure LLM backend in Settings tab
- Go to Generate tab
- Enter workflow description:
"Buffer input points by 500 m, clip with the city boundary, then compute mean population per buffer."
- Optional: set Name/Group, select Context layers, choose Layout profile/organisation/algorithm
- Click Generate Model
- View result in Model tab
| Action | Purpose |
|---|---|
| Model JSON (editable) | View/edit workflow JSON |
| Rebuild model from JSON | Apply manual edits to QGIS model |
| Save .model3 | Export to file loadable in Processing Model Designer |
| Open in Designer | Launch Model Designer with pre-computed layout |
| Auto-wire model steps | Auto-connect missing parameter connections |
| Re-layout current JSON | Re-apply layout without regeneration |
| Auto-layout (Model Forge) | In-Designer re-layout |
- History tab stores recent generation attempts
- Load, rename, delete, or clear past entries
- Restores saved model JSON and layout controls
- Auto-Repair — validates JSON structure and sends repair request to LLM if issues found
- Send repair prompt — describe fixes (e.g., "add dissolve after clip", "rename field to pop_2020")
- Provider selection (OpenAI, Ollama, custom)
- API URL, key, temperature
- Algorithm catalog configuration
Model Forge/
├── model_forge/ # Canonical stitched plugin
│ ├── model_forge.py # Plugin entry point
│ ├── forge_dock.py # Dock widget wrapper
│ ├── forge_widget.py # Main UI (Generate/Model/Settings)
│ ├── forge_generate_worker.py # Background generation thread
│ ├── legacy_base/ # Original LLM->JSON workflow
│ └── compiler_core/ # MCP compiler pipeline
├── model_forge_initial/ # Legacy variant (deprecated)
└── modelforge_arch/ # Architecture variant (deprecated)
| Module | Purpose |
|---|---|
model_forge.py |
Plugin registration, toolbar, menu |
forge_dock.py |
Embeds ForgeWidget into QGIS dock |
forge_widget.py |
UI logic, tab management, LLM wiring |
llm_backend.py |
LLM abstraction layer |
context_collector.py |
Gathers project/algorithm context |
model_builder.py |
JSON -> QingProcessingModelAlgorithm |
model_layout.py |
DAG layout computation |
- LLM calls run in background QThread
- GenerateWorker emits finished(dict) or error(str)
- RepairWorker follows identical pattern
- QSettings with prefix
ModelForge/ - Stores: backend config, URL, API key, temperature, algorithm catalog
{
"inputs": [{ "id": "input_points", "type": "vector", "geometry": "point" }],
"algorithms": [
{
"id": "buffer_step",
"algorithm_id": "native:buffer",
"parameters": {
"INPUT": { "type": "child_output", "child_id": "input_points" },
"DISTANCE": 500
}
}
]
}Child outputs use { "type": "child_output", "child_id": "step_id" }. Validation performed by _validate_model() in forge_widget.py.
- Report issues: https://github.com/Wolren/ModelForge/issues
- Verify all external links before relying on them
Last updated: 05.2026




