Skip to content

pranav603/tender-ai

Repository files navigation

Tender AI Evaluator

Tender AI Evaluator is a hackathon-ready AI-assisted tender evaluation system built for government procurement style workflows.

The project helps compare a tender document against bidder submissions and returns an explainable eligibility decision:

  • Eligible
  • Not Eligible
  • Review

The goal is not to replace human procurement officers. The goal is to speed up document review, standardize comparisons, and surface unclear cases for manual verification instead of silently rejecting them.

Live Demo Link

https://tender-ai-3hs7.onrender.com

Problem Statement

Tender evaluation is usually slow and manual because:

  • tender requirements are spread across long PDF documents
  • bidder information is submitted in different formats
  • the same information appears with different wording
  • scanned documents and image-based evidence are harder to read
  • evaluation decisions must be explainable and auditable

This project addresses that by extracting tender criteria, extracting bidder evidence, comparing both, and returning criterion-level explanations.

What This Project Does

The system supports:

  • Tender PDF upload
  • Bidder PDF upload
  • Multiple bidder PDF evaluation
  • Bidder spreadsheet evaluation with CSV/XLSX
  • OCR fallback for scanned PDFs and images
  • Structured evaluation output with evidence and review flags
  • CSV export for spreadsheet-style reporting
  • React dashboard frontend for demo use

Core Flow

The backend follows this pipeline:

  1. Read document text
  2. Extract tender criteria
  3. Extract bidder data
  4. Compare bidder data against criteria
  5. Return an explainable response

For each criterion, the system decides:

  • Passed
  • Failed
  • Review
  • Not Applicable

If a value is missing, unclear, or ambiguous, the system prefers Review instead of unsafe auto-rejection.

Current Criteria Supported

The current hackathon version extracts and evaluates:

  • Minimum turnover
  • Similar projects completed
  • GST
  • ISO
  • PAN
  • EMD

These are handled with simple pattern matching and rule-based evaluation to keep the project lightweight and readable.

Output Structure

The /evaluate endpoint returns a structured response with:

  • overall_status
  • summary
  • overall_explanation
  • confidence_score
  • ai_verification
  • criteria_results
  • extracted_criteria
  • extracted_bidder_data

Each criterion result includes:

  • criterion name
  • mandatory flag
  • status
  • requirement
  • bidder value
  • explanation
  • decision basis
  • confidence score
  • review flag
  • tender evidence
  • bidder evidence
  • approximate source references

This makes the decision easier to audit and present.

Project Structure

tender-ai/
  app/
    __init__.py
    document_utils.py
    evaluation.py
    extraction.py
    schemas.py
    spreadsheet_utils.py
  frontend/
    index.html
    package.json
    postcss.config.js
    tailwind.config.js
    vite.config.js
    src/
      App.jsx
      index.css
      main.jsx
      components/
        Navbar.jsx
        UploadPanel.jsx
        ResultsPanel.jsx
        CriteriaTable.jsx
  main.py
  pyproject.toml
  README.md

Backend Overview

main.py

This is the FastAPI entrypoint. It exposes the API routes and connects document reading, extraction, and evaluation logic.

app/document_utils.py

Handles:

  • PDF text extraction using PyMuPDF
  • OCR fallback for scanned PDFs
  • OCR for image uploads
  • basic document-type handling

app/extraction.py

Handles:

  • extracting tender criteria from text
  • extracting bidder data from text
  • building evidence snippets and approximate references

app/evaluation.py

Handles:

  • criterion-by-criterion comparison
  • pass/fail/review logic
  • structured summary generation
  • confidence scoring
  • simple AI verification metadata

app/spreadsheet_utils.py

Handles:

  • reading bidder spreadsheets from CSV/XLSX
  • mapping rows to bidder fields
  • bulk evaluation support
  • CSV export generation

app/schemas.py

Defines the Pydantic models used across the backend.

Frontend Overview

The frontend is built with:

  • React
  • Vite
  • Tailwind CSS
  • Axios

It provides a modern dashboard UI with:

  • glassmorphism cards
  • dark mode
  • upload panel
  • results panel
  • criteria table with expandable details

API Endpoints

GET /

Health check.

POST /tender/extract

Extracts criteria from a tender file.

POST /bidder/extract

Extracts bidder details from a bidder file.

POST /evaluate

Evaluates one bidder against one tender.

POST /evaluate/multiple

Evaluates multiple bidder files against one tender.

POST /evaluate/spreadsheet

Evaluates a bidder CSV/XLSX sheet against one tender.

POST /evaluate/spreadsheet/export

Exports a CSV summary of spreadsheet evaluation results.

Docker Deploy

This repo includes a Dockerfile for a single-service deployment on Render.

What it does:

  • builds the Vite frontend
  • installs the FastAPI backend
  • installs Tesseract OCR for scanned PDF/image fallback
  • serves the frontend and API from the same URL

Local Docker Run

docker build -t tender-ai .
docker run -p 10000:10000 tender-ai

Then open http://localhost:10000.

Render Setup

Create a new Render Web Service and choose:

  • Environment: Docker
  • Branch: main
  • Instance type: Free

Render will build from the included Dockerfile and expose the app on the PORT environment variable automatically.

This repo also includes render.yaml so Render can detect the service settings directly from the repository.

Exports spreadsheet evaluation results as CSV.

Setup Instructions

1. Backend Setup

Requirements:

  • Python 3.13+
  • uv recommended
  • Tesseract OCR installed if you want OCR support

Install backend dependencies:

uv sync

Run the backend:

uv run uvicorn main:app --reload

Backend URL:

http://127.0.0.1:8000

Swagger docs:

http://127.0.0.1:8000/docs

2. Frontend Setup

Move into the frontend folder:

cd frontend

Install frontend dependencies:

npm install

Run the frontend:

npm run dev

Frontend URL:

http://127.0.0.1:5173

OCR Note

OCR support depends on both Python packages and the system-level Tesseract binary.

Python dependencies already included:

  • pytesseract
  • pillow

You may also need to install Tesseract on your machine:

  • Ubuntu: sudo apt install tesseract-ocr
  • macOS: brew install tesseract
  • Windows: install Tesseract and add it to PATH

If OCR is not installed, text-based PDFs will still work, but scanned PDFs/images may not be readable.

Example Demo Flow

Single bidder evaluation

  1. Start backend
  2. Start frontend
  3. Open the dashboard
  4. Upload one tender PDF
  5. Upload one bidder PDF
  6. Click Evaluate
  7. Review overall result and criterion-level evidence

Spreadsheet evaluation

Use the backend API directly through Swagger for now:

  1. Open /docs
  2. Use /evaluate/spreadsheet
  3. Upload one tender file
  4. Upload bidder CSV/XLSX
  5. Review JSON output or download CSV from /evaluate/spreadsheet/export

Suggested Bidder Spreadsheet Format

Example CSV:

bidder_name,turnover,similar_projects_completed,gst_available,iso_available,pan_available,emd_available
Acme Infra,62000000,4,yes,yes,yes,yes
Delta Works,42000000,2,yes,no,yes,no
Zenith Projects,,3,yes,yes,yes,yes

Design Principles

This project intentionally stays simple:

  • no heavy ML pipeline
  • no agent orchestration
  • no complex workflow engine
  • no large database layer

Instead, it focuses on:

  • clarity
  • explainability
  • safe review handling
  • hackathon-friendly implementation

Current Strengths

  • Working FastAPI backend
  • OCR-aware document reading
  • Structured extraction and evaluation
  • Review handling for unclear evidence
  • Explainable criterion-level output
  • Bulk spreadsheet evaluation
  • Modern React dashboard

Current Limitations

This is still a hackathon MVP, so some limitations remain:

  • page references are approximate, not exact
  • extraction is rule-based and supports a limited set of criteria
  • scanned document quality depends on OCR quality
  • legal nuance in real tenders is broader than the current patterns

Recommended Next Steps

If extending after the hackathon, good next upgrades would be:

  1. exact page-aware evidence references
  2. richer criteria support
  3. stronger OCR confidence handling
  4. downloadable audit report in PDF/XLSX
  5. frontend flow for spreadsheet upload and export

Why This Project Matters

Government tender evaluation is a high-friction process where time, consistency, and auditability matter. This project demonstrates how AI-assisted extraction and rule-based evaluation can make that process faster and more transparent while still keeping humans in control of final decisions.

About

AI-powered tender evaluation demo for comparing bidder documents against tender criteria.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors