Spaces:
Running
A newer version of the Gradio SDK is available: 6.27.0
title: Geoai Coding Agent
emoji: π
colorFrom: pink
colorTo: red
sdk: gradio
sdk_version: 6.3.0
app_file: app.py
pinned: false
license: agpl-3.0
tags:
- geospatial
- geospatial-ai
- AI
- ML
- DL
- LLM
- satellite-data
- earth-observation
- nlp
- maps
- data-visualization
- natural-language
- gradio
- huggingface
short_description: GeoAI Coding Agent - Geospatial AI Coding Assistant"
π GeoAI Coding Agent
A Geospatial AI Coding Assistant powered by multiple LLMs via HuggingFace Inference Providers.
Specialized in GDAL/OGR, Rasterio, GeoPandas, xarray, and geospatial development across multiple programming languages. Designed for beginner and intermediate learners with educational explanations.
β¨ Features
- π€ Multiple AI Models: Choose from 6 different models (DeepSeek, Kimi, Llama, MiniMax, GLM, Mistral)
- πΊοΈ Geospatial Expertise: Deep knowledge of GDAL, Rasterio, GeoPandas, PyProj, xarray, and rioxarray
- π Educational Focus: Responses include code explanations, step-by-step logic, and tips for beginners
- π» Multi-Language Support: Python, Java, C/C++, JavaScript, TypeScript, Rust
- π₯ Download Options: Export responses as Markdown or code files
- π¨ Code Editor Style UI: Syntax highlighting with dark theme
- β‘ Streaming Responses: Real-time token streaming for better UX
π€ Available Models
| Model | Provider | Speed | Best For |
|---|---|---|---|
| DeepSeek V3.2 | Novita | Medium | Complex geospatial tasks, detailed explanations |
| Kimi K2 Instruct | Novita | Medium | General coding, good balance |
| Llama 3.1 8B | Novita | Fast | Quick answers, simple tasks |
| MiniMax M2.1 | Novita | Medium | Creative solutions |
| GLM 4.7 Flash | Novita | Fast | Fast responses, basic tasks |
| Mistral 7B v0.2 | Featherless | Fast | Quick prototyping |
π‘ Tip: Larger models provide better results but take longer. Smaller models are faster for simple queries.
π Quick Start
Local Development
Clone the repository
git clone https://github.com/rifatSDAS/geoai-coding-agent.git cd geoai-coding-agentCreate virtual environment
python -m venv venv source venv/bin/activate # Linux/Mac # or venv\Scripts\activate # WindowsInstall dependencies
pip install -r requirements.txtRun the application
python app.pyOpen in browser: Navigate to
http://localhost:7860Enter your HuggingFace token: Get one at huggingface.co/settings/tokens
Run Tests
pytest test_app.py -v
π³ HuggingFace Spaces Deployment
Create a new Space at huggingface.co/new-space
- Select Gradio as the SDK
- Choose CPU basic (free tier)
Upload files
app.pyconfig.pyrequirements.txtREADME.md(optional)
That's it! The Space will automatically build and deploy.
π Project Structure
geoai-coding-agent/
βββ app.py # Main Gradio application
βββ config.py # Configuration, prompts, templates
βββ test_app.py # Unit tests
βββ requirements.txt # Python dependencies
βββ .gitignore # Git ignore rules
βββ README.md # This file
π― Example Queries
- "Read a GeoTIFF with rasterio and calculate NDVI from Sentinel-2 bands"
- "Convert shapefile to GeoJSON using GDAL/OGR in Python"
- "Reproject a raster from EPSG:4326 to EPSG:32632 using rasterio"
- "Clip a large COG raster to a polygon boundary using rioxarray"
- "Create a spatial join between two GeoDataFrames in GeoPandas"
- "Implement parallel raster processing with GDAL in C++"
βοΈ Configuration
Key settings in config.py:
| Parameter | Default | Description |
|---|---|---|
DEFAULT_MODEL |
DeepSeek V3.2 |
Default model selection |
MAX_NEW_TOKENS |
2048 |
Maximum response length |
TEMPERATURE |
0.3 |
Sampling temperature (lower = more focused) |
TOP_P |
0.9 |
Nucleus sampling threshold |
AVAILABLE_MODELS |
(see table above) | Dictionary of available models & providers |
π API Token
This application requires a HuggingFace API token with Inference Provider permissions.
Required permissions:
- β Make calls to Inference Providers
Get your free token at: huggingface.co/settings/tokens
For HuggingFace Spaces deployment, add the token as a Secret named HF_TOKEN in Space Settings.
π οΈ Supported Languages
| Language | Extension | Use Case |
|---|---|---|
| Python | .py |
GDAL, Rasterio, GeoPandas |
| Java | .java |
GeoTools, JTS |
| C/C++ | .c, .cpp |
GDAL C API, performance |
| JavaScript | .js |
Leaflet, OpenLayers, Turf.js |
| TypeScript | .ts |
Type-safe geospatial apps |
| Rust | .rs |
GDAL Rust bindings, geo crate |
π¦ Dependencies
- gradio: Web UI framework
- huggingface-hub: HF Inference API client
- pytest: Testing framework
π Acknowledgments
- Inspired by GeoAI-Assistance-Ext VS Code Extension
- Powered by multiple LLMs via HuggingFace Inference Providers
- Built with Gradio
About the Developer
Built by Dr. Kazi Rifat Ahmed, a Full Stack Geospatial AI Engineer, Co-founder and Technical Lead for Satellite Data Services business in Space sector.
Contributing
Contributions welcome! Please feel free to submit issues and pull requests.
Contact
For collaboration opportunities in satellite data services & applications, large-scale satellite data analytics, geospatial AI, blockchain & quantum computing for geospatial applications, or advanced geospatial science, technology & applications, feel free to reach out!
Portfolio at https://rifatsdas.github.io/
π License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
See LICENSE for details.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference