A QGIS plugin that provides a simple interface to send prompts to various LLM providers and execute the generated Python code in QGIS.
Send custom prompts to multiple LLM providers
View both full LLM responses and extracted code
Edit and execute code within QGIS
Lightweight UI
Requirement
Details
QGIS
3.x
Python
3.x
Dependencies
requests package
Ollama
Ollama (local/remote)
Other Providers
Valid API key
Download or clone this repository.
Copy QGISPromptExecutor to the QGIS plugins directory:
Windows: C:\Users\{username}\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
Linux: ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins
macOS: ~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
Enable the plugin via Plugins > Manage and Install Plugins .
Download the ZIP file.
Install via Plugins > Manage and Install Plugins > Install from ZIP .
''' This Plugin Will soon be available on the QGIS plugin store for easier installation'''
Open Plugins > Promptly or click the toolbar icon.
Select an LLM provider.
Configure settings (API Key, Endpoint, Model, etc.).
Enter a prompt and click Send to LLM .
Review results:
Full Response : Complete LLM output.
Executable Code : Extracted Python code.
Edit and execute code within QGIS.
Provider-Specific Settings
Provider
API Endpoint
Model
API Key Required?
Ollama
http://localhost:11434/api/generate
Depends on local models
No
OpenAI
https://api.openai.com/v1/chat/completions
gpt-4o, gpt-3.5-turbo, etc.
Yes
OpenRouter
https://openrouter.ai/api/v1/chat/completions
OpenAI, Anthropic, and others
Yes
Anthropic
https://api.anthropic.com/v1/messages
claude-3-opus, claude-3-sonnet
Yes
Custom
User-defined
User-defined
Yes (if required)
Task
Example Prompt
Calculate area
"Calculate area of 'buildings' layer and add as 'area_sqm'"
Buffer creation
"Create 100m buffer around 'rivers' and save as new layer"
Style update
"Change 'roads' layer color based on 'type' attribute"
Issue
Solution
API Key Issues
Ensure the key is valid and not expired.
Model Selection
Check model availability in your subscription.
Network Issues
Verify connection and firewall settings.
Response Format
Ensure LLM outputs Python code within ```python blocks.
This plugin is licensed under the MIT License .