LLM Agri Bot AI Agent

by mohammed97ashraf• 56•• Scanned•Claim this listing•Request removal
Data Science & MLagriculturalchatbotflaskflask applicationhugging face

This Chatbot helps farmers make informed decisions by leveraging the power of LLM Model from OpenAI.

LLM Agri Bot is an open-source ai agent by mohammed97ashraf, written mainly in Python, with 56 GitHub stars and the MIT license. Its code was last updated Jun 21, 2026.

<div align="center">

Krishi Sahayak

AI Agriculture Assistant for Indian Farmers

Python Flask Groq License Deploy uv

Live Demo → llm-agri-bot.onrender.com

An AI-powered agriculture chatbot that helps Indian farmers with crop advice, pest control, soil health, weather, and government schemes — using text, voice, and image analysis.

<br/>

Krishi Sahayak — Web Interface

</div>

Features

FeatureDescription
Text ChatAsk any agriculture question and get expert answers
Image DiagnosisUpload a crop photo → AI identifies diseases, pests & deficiencies
Voice InputSpeak in English, Hindi, or Hinglish via Groq Whisper
Voice OutputBot reads answers aloud using Groq Orpheus TTS
Conversation MemoryRemembers your chat context (Redis, with in-memory fallback)
Prompt Caching50% cost savings — cached prefixes across requests
Dark/Light ThemeGlassmorphism UI with one-click theme toggle
MultilingualResponds in English, Hindi, or Hinglish

Krishi Sahayak — Voice Chat on Mobile


Tech Stack

<table> <tr> <td><strong>Backend</strong></td> <td>Python 3.11+, Flask, Groq SDK</td> </tr> <tr> <td><strong>Frontend</strong></td> <td>HTML5, CSS3 (Glassmorphism), jQuery</td> </tr> <tr> <td><strong>LLM</strong></td> <td><code>openai/gpt-oss-120b</code> (text), <code>meta-llama/llama-4-scout-17b-16e-instruct</code> (vision)</td> </tr> <tr> <td><strong>Speech</strong></td> <td>Groq Whisper <code>whisper-large-v3-turbo</code> (STT), Groq Orpheus <code>canopylabs/orpheus-v1-english</code> (TTS)</td> </tr> <tr> <td><strong>Memory</strong></td> <td>Redis (with automatic in-memory fallback)</td> </tr> <tr> <td><strong>Deploy</strong></td> <td>Render, Docker, Gunicorn</td> </tr> </table>

Quick Start

Prerequisites

1. Clone & Install

git clone https://github.com/mohammed97ashraf/LLM_Agri_Bot.git
cd LLM_Agri_Bot
uv sync

2. Configure

cp .env.example LLM_Agri_Bot/.env

Edit LLM_Agri_Bot/.env and add your Groq API key:

GROQ_API_KEY=gsk_your_key_here

3. Run

uv run python LLM_Agri_Bot/run.py

Open http://127.0.0.1:5000


Environment Variables

Copy .env.example to LLM_Agri_Bot/.env and configure:

VariableRequiredDefaultDescription
GROQ_API_KEYYes—Your Groq API key (get one)
LLM_MODELNoopenai/gpt-oss-120bText LLM model
LLM_VISION_MODELNometa-llama/llama-4-scout-17b-16e-instructVision LLM model
LLM_TEMPERATURENo0.3Model temperature (0–2)
LLM_MAX_TOKENSNo2048Max response tokens
STT_MODELNowhisper-large-v3-turboSpeech-to-text model
TTS_MODELNocanopylabs/orpheus-v1-englishText-to-speech model
TTS_VOICENoautumnTTS voice name
REDIS_HOSTNolocalhostRedis host (optional — falls back to memory)
REDIS_PORTNo6379Redis port
REDIS_SSLNofalseEnable Redis SSL
FLASK_SECRET_KEYYes*dev-secret-keyFlask session secret (*required in production)
FLASK_DEBUGNotrueEnable debug mode

Project Structure

LLM_Agri_Bot/
├── app/
│   ├── __init__.py             # App factory (create_app)
│   ├── config.py               # Environment-based configuration
│   ├── routes/
│   │   ├── main.py             # Index page, robots.txt, sitemap, llms.txt
│   │   └── chat.py             # Chat API (text, voice, image)
│   ├── services/
│   │   ├── llm_service.py      # Groq LLM + vision + prompt caching
│   │   ├── memory_service.py   # Redis + in-memory fallback
│   │   ├── stt_service.py      # Groq Whisper STT
│   │   ├── tts_service.py      # Groq Orpheus TTS
│   │   └── prompt_manager.py   # XML + CoT system prompt
│   ├── static/
│   │   ├── css/style.css       # Glassmorphism UI (dark/light)
│   │   ├── js/chat.js          # Chat logic, image upload, voice
│   │   └── images/             # Favicon
│   └── templates/
│       └── index.html          # Main template (SEO + JSON-LD)
├── Sample_image/               # Screenshots for README
├── llms.txt                    # AI crawler disclosure
├── .env.example                # Environment template
├── gunicorn.conf.py            # Production Gunicorn config
├── Dockerfile                  # Docker deployment
├── render.yaml                 # Render blueprint
├── run.py                      # Dev entry point
├── pyproject.toml              # uv / project config
└── requirements.txt            # pip fallback

Deployment

Render (Recommended)

  1. Push your code to GitHub
  2. Go to render.com → New → Web Service
  3. Connect your GitHub repo
  4. Render auto-detects render.yaml and Dockerfile
  5. Add your GROQ_API_KEY (and other env vars) in the Render dashboard
  6. Click Deploy

Docker

docker build -t krishi-sahayak .
docker run -p 10000:10000 --env-file LLM_Agri_Bot/.env krishi-sahayak

API Reference

MethodEndpointDescription
GET/Chat interface
POST/chatSend text, image, or audio — returns AI response
POST/chat/clearClear conversation history
GET/healthHealth check (Redis status)
GET/robots.txtSearch engine crawl rules
GET/sitemap.xmlXML sitemap
GET/llms.txtAI crawler disclosure
GET/.well-known/llms.txtAI crawler disclosure (well-known path)

How It Works

User sends message (text / image / voice)
        │
        ▼
┌─────────────────────────────────────────┐
│  Flask Backend                          │
│  ├── Text? → Groq LLM (gpt-oss-120b)  │
│  ├── Image? → Llama 4 Scout (vision)   │
│  └── Voice? → Whisper STT → LLM → TTS  │
│                                         │
│  Memory: Redis (or in-memory fallback)  │
│  Cache:  Groq automatic prompt caching  │
└─────────────────────────────────────────┘
        │
        ▼
Response with text + optional voice audio

Contributing

Contributions welcome! See CONTRIBUTING.md.

git checkout -b feature/your-feature
uv sync
# make changes
git commit -m "Add your feature"
git push origin feature/your-feature

License

MIT License — see LICENSE


<div align="center">

Built with care for Indian farmers

By Mohammed Ashraf · GitHub · LinkedIn

</div>

LLM Agri Bot alternatives

View more →

Similar ai agents in Data Science & ML, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.

NameStarsLicenceLast updatedScan
LLM Agri Bot (this page)
mohammed97ashraf
56MITJun 21, 2026Scanned, no flagged issues
Ragflow
infiniflow
93kApache-2.0Oct 31, 2026Scanned, no flagged issues
Cherry Studio
CherryHQ
53kAGPL-3.0Nov 1, 2026Scanned, no flagged issues
PageIndex
VectifyAI
40kMITOct 29, 2026Scanned, no flagged issues
Graphiti
getzep
32kApache-2.0Nov 1, 2026Scanned, no flagged issues
Cua
trycua
31kMITNov 1, 2026Scanned, no flagged issues