A Streamlit-based web application that integrates Sarvam AI to provide Text-to-Speech conversion and AI-powered conversational responses with audio output — all in one place.
- Text to Speech — Convert any text input into natural-sounding speech using Sarvam AI's
bulbul:v3TTS model with theratanspeaker voice. - Ask AI — Submit a query to Sarvam AI's
sarvam-mchat model and receive both a text response and its spoken audio version. - Personalized experience — Enter your name to have your messages displayed with your name in the chat.
- Sidebar navigation — Clean option menu for switching between app sections.
- Streamlit — Frontend UI framework
- Sarvam AI — Text-to-Speech & LLM APIs
- streamlit-option-menu — Sidebar navigation
- python-dotenv — Environment variable management
- Python 3.8+
- A Sarvam AI account and API key
- Clone the repository:
git clone https://github.com/your-username/multi_model_ai_project.git
cd multi_model_ai_project- Install dependencies:
pip install -r requirements.txt-
Set up your API key. You can do this in one of two ways:
Option A —
.envfile (local development):SARVAM_API_KEY=your_api_key_hereOption B — Streamlit secrets (deployment):
Create.streamlit/secrets.toml:SARVAM_API_KEY = "your_api_key_here"
streamlit run app.py- Open the app in your browser (usually at
http://localhost:8501). - Optionally enter your name in the sidebar.
- Use Text to Speech to convert any text to audio, or use Ask AI to submit a question and get both a written and spoken response.
multi_model_ai_project/
├── app.py # Main Streamlit application
├── .env # Local environment variables (not committed)
├── .streamlit/
│ └── secrets.toml # Streamlit secrets for deployment
├── requirements.txt # Python dependencies
└── README.md
Add the following to your requirements.txt:
streamlit
requests
sarvamai
streamlit-option-menu
python-dotenv
This project is open source. Feel free to fork and build on it.