AndesOps-AI / backend /README.md
Álvaro Valenzuela Valdes
🚀 Fix: Ensure app_port 7860 and simple health check
d4c0b3e
---
title: AndesOps AI Backend
emoji: 🤖
colorFrom: purple
colorTo: blue
sdk: docker
app_port: 7860
startup_duration_timeout: 30m
python_version: 3.11
---
# AndesOps AI - Backend API
Real-time Chilean public procurement market intelligence with AI-powered analysis.
## 🚀 Features
- **Real-time Market Data**: Access Mercado Público (Chile's public procurement) API
- **Purchase Orders (OC)**: Monitor purchase orders across Chilean government agencies
- **Tender Analysis**: AI-powered tender matching and recommendation
- **LLM Integration**: Powered by Google Gemini, Groq, and Featherless AI
- **REST API**: Full-featured FastAPI backend
## 📋 Environment Variables Required
Add these in **Settings → Secrets** on Hugging Face:
```
MERCADO_PUBLICO_TICKET=99B4CA8C-C1DF-4E3F-B5CF-C1672D432A91
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
FEATHERLESS_API_KEY=your_featherless_key
DATABASE_URL=sqlite:///./andesops.db
GEMINI_MODEL=gemini-2.5-flash
```
## 🔗 API Endpoints
- `GET /api/health` - Health check
- `GET /api/tenders?keyword=...` - Search tenders
- `GET /api/tenders/scrape?keyword=...` - Scrape Compra Ágil
- `GET /api/purchase-orders?date=ddmmaaaa` - Get purchase orders
- `POST /api/analyze` - Analyze tender with AI
- `POST /api/company-profile` - Save company profile
## 🔌 CORS Configuration
Automatically enabled for frontend at: `https://{user}-andesai-frontend.hf.space`
## 📦 Backend Stack
- **Framework**: FastAPI 0.109.0
- **Database**: SQLite (local) / MySQL (production)
- **AI Models**: Google Gemini, Groq, Featherless
- **Web Scraping**: httpx, BeautifulSoup4
- **Validation**: Pydantic v2
## 🚦 Status
- ✅ Mercado Público API integration
- ✅ Real-time purchase order monitoring
- ✅ Tender scraping (Compra Ágil)
- ✅ AI-powered analysis
- ✅ CORS configured for frontend integration
## 📞 Support
Part of **AndesOps AI** - a complete platform for Chilean public procurement intelligence.
Connect with the frontend space for the full application experience.