Skip to content
TerraForge

TerraForge

TerraForge powers data-driven climate action

Created on 22nd March 2026

β€’

TerraForge

TerraForge

TerraForge powers data-driven climate action

The problem TerraForge solves

🌍 TerraForge: Environmental Intelligence OS

Bridging rural agricultural diagnostics with government-level climate policy using Hybrid Edge-AI


πŸ“– Overview

TerraForge is an AI-driven Environmental Operating System for real-time environmental tracking and predictive policy simulation, enabling governments and citizens to make proactive, data-driven climate decisions.

Unlike cloud-dependent AI systems (high latency, API costs, bandwidth-heavy), TerraForge uses a Hybrid Edge-AI architecture with locally deployed, quantized 1.1B parameter LLMs, ensuring:

  • ⚑ Zero API costs
  • πŸ”’ Complete data privacy
  • βš™οΈ Low-latency performance

πŸš€ Core AI Pipeline (Local ML)

A tightly integrated pipeline of optimized models:

🧠 TinyLlama-1.1B (Core LLM)

Dual LoRA adapters:

  • Agricultural Diagnostic LLM β†’ Crop/Livestock issue detection
  • Policy Strategy LLM β†’ 3-tier plans (Strict / Moderate / Advisory)

πŸ‘‰ Key Innovation: Real-Time Prompt Injection
Live API + ML outputs are injected into prompts before generation:

  • βœ” No hallucinations
  • βœ” Context-aware outputs
  • βœ” Scientifically grounded explanations

🌐 NLLB-200 (Translation Layer)

  • Converts regional languages β†’ English β†’ back to native
  • Enables multilingual rural accessibility

πŸŽ™οΈ Whisper (Speech Input)

  • Voice-to-text for non-technical users

πŸ”Š gTTS (Speech Output)

  • Converts responses into audio (.mp3)

πŸ“Š Random Forest (Prediction Engine)

  • Processes AQI, rainfall, feed, temperature, etc.
  • Predicts yield changes (e.g., milk/crop output)
  • Feeds results into LLM for explanation

πŸ–₯️ Frontend Ecosystem

Built with Next.js + React + TailwindCSS + Shadcn UI

πŸ‘¨β€πŸŒΎ Farmer Dashboard

  • 🌦️ Live weather & AQI (Open-Meteo API)
  • πŸ“‰ Yield prediction from real-time stress factors
  • 🎀 Multilingual voice assistant (speech + audio output)
  • πŸ“‘ Works in low/no internet environments

πŸ›οΈ Government Dashboard

  • πŸ—ΊοΈ Geospatial map (react-leaflet)
  • πŸ”₯ NASA FIRMS fire hotspot overlay
  • πŸ€– AI-generated policy recommendations
  • πŸ§ͺ β€œWhat-if” simulation sandbox
  • πŸ“„ Auto PDF reports (jsPDF)

🧠 Architecture (API + AI Flow)

Separated into Training (Past) and Inference (Present/Future)

πŸ—οΈ Phase 1: Offline Training

  • Historical data (2021–2024)
  • Granger Causality (statsmodels) β†’ discovers environmental relationships
  • Train RandomForest regressors β†’ saved as lightweight models

⚑ Phase 2: Live Inference

  1. Fetch live APIs (Open-Meteo, OpenAQ, NASA FIRMS)
  2. Apply trained rules β†’ instant predictions
  3. Inject results into TinyLlama prompt
  4. Generate explanation
  5. Translate (NLLB) + Voice output (gTTS)

πŸ“Š Foundational Datasets

  • πŸ”₯ Fires & Emissions β†’ NASA FIRMS, Climate TRACE
  • 🌫️ Air & Weather β†’ OpenAQ, IMD
  • πŸ’§ Water β†’ Central Ground Water Board
  • 🌾 Agriculture β†’ ISRO/USGS (NDVI), Animal Husbandry (Milk Yield)
  • πŸ’° Economy β†’ Agmarknet, Census of India

πŸ’» Tech Stack & Deployment

Frontend:
Next.js 14, React, TailwindCSS, Shadcn UI, React-Leaflet, jsPDF

Backend:
Python, FastAPI

ML Stack:
transformers, statsmodels, scikit-learn, pandas

Models:
TinyLlama, NLLB-200, Whisper

Database:
Supabase (PostgreSQL)


πŸš€ Deployment Strategy

  • 🌐 Frontend β†’ Vercel (Global CDN)
  • 🧠 Backend β†’ Local GPU execution
  • πŸ”— Public Access β†’ Ngrok / Cloudflare Tunnels

πŸ’‘ Core Value

  • Offline-first AI
  • Zero API dependency
  • Real-time + predictive intelligence
  • Multilingual + voice-enabled
  • Scalable from farmers β†’ government systems

Built for the future. Running locally. Healing globally. πŸŒ±πŸš€

Challenges we ran into

⚑ Challenges I Ran Into

🧠 Running LLMs Locally Without Crashes

One of the biggest challenges was running a 1.1B parameter LLM locally with limited GPU/CPU resources. Initially, the model either crashed or had very slow inference times.

How I solved it:

  • Used quantization techniques to reduce memory usage
  • Optimized inference with CPU fallback when GPU wasn’t available
  • Reduced token generation limits for faster responses

πŸ”„ Eliminating AI Hallucinations

The LLM initially produced generic or incorrect answers due to lack of real-time environmental awareness.

How I solved it:

  • Implemented real-time prompt injection
  • Injected live API data + ML predictions directly into the prompt
  • Ensured outputs were context-aware and fact-based, not guessed

🌐 Multilingual Pipeline Integration

Integrating NLLB (translation) + TinyLlama (LLM) + Whisper (speech) into a single pipeline caused latency and formatting issues.

Problems faced:

  • Incorrect translations breaking prompts
  • Delays due to multiple model calls

Solution:

  • Standardized all inputs into English before LLM processing
  • Optimized pipeline flow:
    Speech β†’ Translation β†’ LLM β†’ Translation β†’ Audio
  • Reduced token size to improve speed

πŸ“‘ Handling Real-Time APIs Reliably

Live APIs (weather, AQI, NASA FIRMS) sometimes returned inconsistent or missing data, affecting predictions.

How I solved it:

  • Added fallback/default values
  • Implemented validation and error handling layers
  • Cached recent API responses to ensure reliability

πŸ—ΊοΈ Geospatial Map Performance

Rendering real-time data (fire hotspots, regions) using react-leaflet caused UI lag and overlapping issues.

Solution:

  • Implemented marker clustering
  • Limited real-time refresh frequency
  • Filtered only relevant data points for rendering

πŸ”Š Voice Input/Output Sync Issues

There were delays and mismatches between speech input (Whisper) and audio output (gTTS).

Fix:

  • Added async handling and proper sequencing
  • Ensured text confirmation before generating audio
  • Optimized audio generation timing

πŸ’‘ Key Learning

Building TerraForge showed that the hardest part of AI systems isn’t just the modelsβ€”
it’s orchestrating LLMs, APIs, ML models, and UI into a reliable real-time system.

Tracks Applied (1)

GreenTech

🌱 Green Tech Track Justification TerraForge directly aligns with the Green Tech track by enabling data-driven environm...Read More

Discussion

Builders also viewed

See more projects on Devfolio