geoai-coding-agent / README.md
rifatSDAS's picture
Initial commit: GeoAI Coding Agent app
2206408

A newer version of the Gradio SDK is available: 6.4.0

Upgrade
metadata
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 Qwen/Qwen2.5-Coder-7B-Instruct via HuggingFace Inference API.

Specialized in GDAL/OGR, Rasterio, GeoPandas, xarray, and geospatial development across multiple programming languages.

Python Gradio License

✨ Features

  • πŸ—ΊοΈ Geospatial Expertise: Deep knowledge of GDAL, Rasterio, GeoPandas, PyProj, xarray, and rioxarray
  • πŸ’» Multi-Language Support: Python, Java, C/C++, JavaScript, TypeScript, Rust
  • πŸ“₯ Download Options: Export responses as Markdown, Jupyter Notebooks, or code files
  • 🎨 Code Editor Style UI: Syntax highlighting with dark theme
  • πŸ”’ BYOT (Bring Your Own Token): Uses your HuggingFace API token for inference
  • ⚑ Streaming Responses: Real-time token streaming for better UX

πŸš€ Quick Start

Local Development

  1. Clone the repository

    git clone https://github.com/rifatSDAS/geoai-coding-agent.git
    cd geoai-coding-agent
    
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # Linux/Mac
    # or
    venv\Scripts\activate  # Windows
    
  3. Install dependencies

    pip install -r requirements.txt
    
  4. Run the application

    python app.py
    
  5. Open in browser: Navigate to http://localhost:7860

  6. Enter your HuggingFace token: Get one at huggingface.co/settings/tokens

Run Tests

pytest test_app.py -v

🐳 HuggingFace Spaces Deployment

  1. Create a new Space at huggingface.co/new-space

    • Select Gradio as the SDK
    • Choose CPU basic (free tier)
  2. Upload files

    • app.py
    • config.py
    • requirements.txt
    • README.md (optional)
  3. 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
MODEL_ID Qwen/Qwen2.5-Coder-7B-Instruct HuggingFace model
MAX_NEW_TOKENS 2048 Maximum response length
TEMPERATURE 0.3 Sampling temperature (lower = more focused)
TOP_P 0.9 Nucleus sampling threshold

πŸ”‘ API Token

This application requires a HuggingFace API token for inference. This design:

  • βœ… Keeps the Space free (no server-side costs)
  • βœ… Prevents token limit overflow
  • βœ… Gives users control over their usage

Get your free token at: huggingface.co/settings/tokens

πŸ› οΈ 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

About the Developer

Built by Dr. Kazi Rifat Ahmed, a Full Stack Geospatial AI Engineer specializing in:

  • AI/ML-DL for geospatial applications
  • Cloud-native geospatial software engineering & architecture
  • Large-scale Satellite/Earth Observation data data analysis, processing, analytics, and visualization
  • Blockchain and Quantum Computing for geospatial applications
  • Research Advanced Geospatial Science, Technology, and Applications
  • Co-founder and Technical Lead for Satellite Data Services business in Space sector, i.e., QuentuED (https://quentued.de) and Sensor Aktor (https://sensor-aktor.de)

Tech Stack Proficiency

Python | Java | JavaScript | TypeScript | C/C++ | Bash | Cloud-Native Architecture (kubernetes) | DevOps | AI/ML/DL | MLOps | LLM Integration | Blockchain | Remote Sensing Science & Technology | Geospatial Data Science & Engineering

Research Interests

Geospatial AI | Satellite Data Engineering | Drone Sensors | Geospatial Big Data Analytics | Earth Observation Systems & Sensors | Advanced Remote Sensing Techniques | Space Technology | Quantum Computing | Blockchain | | Satellite Data Services | Planetary Science & Exploration

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: pytest test_app.py -v
  5. Submit a pull request

πŸ“„ License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).

See LICENSE for details.

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!


Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference