# 🧾 VoiceBill AI – Voice-Powered Autonomous Invoice Generator **VoiceBill AI** is a fully autonomous, intelligent agent that generates professional invoices directly from user voice commands. It uses state-of-the-art audio-language models like **Qwen2-Audio-7B-Instruct** to interpret voice, extract structured data using **Pydantic**, cross-check and auto-complete information from a local database, and generates polished PDF invoices using **ReportLab** β€” all wrapped in a clean **Gradio** UI. > 🎯 Designed for freelancers, SMBs, and enterprises that need intelligent, conversational billing β€” fast. --- ## πŸš€ Demo
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/your-repo/VoiceBill_AI/blob/main/InvoiceGenerator.ipynb)
--- ## πŸ—£οΈ Input Audio Samples Here are the audio inputs that were used for invoice generation: - πŸ”Š [John Doe's Invoice Request](https://git.gyannetra.in/HardikSankhla/VoiceInvoiceAI_Demo/raw/main/audio_inputs/audio1JohnDoe.wav) - πŸ”Š [Sarah Miller's Invoice Request](https://git.gyannetra.in/HardikSankhla/VoiceInvoiceAI_Demo/raw/main/audio_inputs/audio2SarahMilller.wav) ## πŸ“Š Results Here is a sample output invoice generated by VoiceBill AI:

Generated Invoice - Page 1 Generated Invoice - Page 2

## 🎯 Objective Enable users to **speak naturally** about invoice requirements while the AI: - Understands and parses spoken content - Auto-fills missing fields from local memory - Follows up with intelligent prompts if any required field is missing - Builds and exports a **professional PDF invoice** - Works seamlessly via a user-friendly Gradio UI --- ## 🧠 System Workflow 1. **πŸŽ™οΈ Voice Input**: User says: _"Generate an invoice for Ramesh for 2 iPhones and 1 MacBook."_ 2. **🧠 AI Model (Qwen2-Audio)**: Extracts structured data like: - Client: Ramesh - Items: iPhone, MacBook - Quantity: 2, 1 3. **πŸ“¦ Local DB Checks**: - If Ramesh exists β†’ fetch data - If item details missing β†’ asks user - Stores/update user/item info in DB 4. **βœ… Data Validation**: Validates structured input using **Pydantic** 5. **πŸ“„ Invoice Generation**: Generates professional PDF using **ReportLab** 6. **🌐 UI**: All happens within an intuitive Gradio interface --- ## πŸ› οΈ Tech Stack | Function | Tool / Library | |----------------------|--------------------------------------------| | Voice-to-Text | [Qwen2-Audio-7B-Instruct](https://huggingface.co/Qwen/Qwen2-Audio-7B-Instruct) | | Structured Validation| [Pydantic](https://docs.pydantic.dev/) | | Audio Processing | [Librosa](https://librosa.org/) | | UI Interface | [Gradio](https://www.gradio.app/) | | PDF Invoice Builder | [ReportLab](https://www.reportlab.com/) | | Runtime | Python 3.10+, Google Colab/GPU | --- ## πŸ“¦ Features βœ… AI-powered voice input β†’ invoice βœ… Auto-fill from local user/item DB βœ… Modular, structured data validation βœ… Dynamic follow-up on missing fields βœ… Clean, professional invoice layout (PDF) βœ… Gradio UI for real-time interaction βœ… Supports 8-bit model loading (via bitsandbytes) --- ## πŸ“ Folder Structure ```python VoiceBill_AI/ β”‚ β”œβ”€β”€ InvoiceGenerator.ipynb # Main pipeline notebook β”œβ”€β”€ requirements.txt # Install dependencies β”œβ”€β”€ audio_inputs/ # Uploaded or recorded audio β”œβ”€β”€ generated_invoices/ # Output PDFs saved here └── README.md # This file ``` ---- ## βš™οΈ Setup βœ… In Colab - Open notebook in Colab - Ensure GPU is enabled: Runtime > Change Runtime Type > GPU - Run all cells βœ… Local (Experimental) ```python $ git clone https://github.com/your-username/VoiceBill_AI.git $ cd VoiceBill_AI $ pip install -r requirements.txt $ python run_app.py # Optional: if converted to Python script ``` --- ## 🧩 Missing Data Handling (Agentic) - User Info Missing? β†’ β€œWho is the client?” - Item Info Missing? β†’ β€œWhat’s the price for iPhone 15?” - GST or Address Missing? β†’ Prompt and update DB - User Updates Info? β†’ Accept and sync to local DB --- ## πŸ“Œ Future Enhancements - Multi-language support via Whisper or MMS - Full agent framework with LangChain/Ollama integration - Database integration (PostgreSQL/SQLite) - REST API and Streamlit frontend - Voice-based editing of previous invoices --- ## πŸ™Œ Credits Developed by [Gyannetra Pvt Ltd β„’](https://www.gyannetra.com/) Built to simplify billing using cutting-edge AI and local models. Made with πŸ’œ and Python.