AI-Powered Multilingual Translation Platform
LinguaFlow is a resilient multilingual AI translation platform built with Python, Streamlit, Google Gemini, NVIDIA Nemotron, SQLite, and automatic language detection.
The core engineering idea is a multi-provider fallback architecture: Gemini 2.5 Flash handles primary translation, Gemini Flash-Lite provides a secondary fallback, and NVIDIA Nemotron 3 Ultra acts as the final reliability provider.
Try LinguaFlow: https://linguaflowtranslate.streamlit.app/
Source Code: https://github.com/nabinchettri18/CodeAlpha_LinguaFlow
The hosted Streamlit deployment uses the Google GenAI Python SDK directly. Local development can use the Node.js Gemini service.
- ๐ Multilingual AI translation
- ๐ Automatic language detection
- โก SQLite translation caching
- ๐ค Gemini 2.5 Flash primary provider
- ๐ Gemini Flash-Lite secondary fallback
- ๐ก๏ธ NVIDIA Nemotron 3 Ultra final fallback
- โป๏ธ Retry, cooldown, and graceful provider failure handling
- โ Translation output validation
- ๐งฉ Streamlit web interface
- โ๏ธ Streamlit Cloud deployment
- ๐ป Local Node.js Gemini service for development
- ๐ Environment / Streamlit Secrets based configuration
LINGUAFLOW
โ
โผ
SQLite Cache
โ โ
HIT MISS
โ โ
โผ โผ
Result Gemini 2.5 Flash
โ
failure / quota
โผ
Gemini Flash-Lite
โ
failure / quota
โผ
NVIDIA Nemotron 3 Ultra
โ
failure
โผ
TranslationError
A cache hit avoids an unnecessary AI request. On a cache miss, providers are attempted in order until a valid translation is returned or all available providers fail.
LinguaFlow supports two execution modes while keeping the same provider strategy.
Streamlit
โ
Translator
โ
gemini_server.mjs
โ
Node.js :8765
โ
Google Gemini
Local mode:
GEMINI_USE_LOCAL_SERVER=trueThe hosted application does not require Node.js or gemini_server.mjs.
Streamlit Cloud
โ
Python Translator
โ
Google GenAI SDK
โ
Google Gemini
Cloud mode:
GEMINI_USE_LOCAL_SERVER = falseThis hybrid design keeps local development convenient while allowing the deployed application to run without a separate Node.js backend.
| Layer | Technology |
|---|---|
| Frontend | Streamlit |
| Application | Python |
| Local AI service | Node.js |
| Google AI SDK | google-genai |
| Primary model | Gemini 2.5 Flash |
| Secondary model | Gemini Flash-Lite |
| Final fallback | NVIDIA Nemotron 3 Ultra |
| Cache | SQLite |
| Language detection | langdetect |
| HTTP communication | Requests |
| Configuration | .env / Streamlit Secrets |
| Deployment | Streamlit Cloud |
CodeAlpha_LinguaFlow/
โ
โโโ app.py
โโโ gemini_server.mjs
โโโ load_test.py
โโโ package.json
โโโ package-lock.json
โโโ requirements.txt
โโโ README.md
โโโ .gitignore
โ
โโโ src/
โโโ languages.py
โโโ language_detector.py
โโโ main.py
โโโ translator.py
.env, API credentials, and private runtime data should not be committed.
git clone https://github.com/nabinchettri18/CodeAlpha_LinguaFlow.git
cd CodeAlpha_LinguaFlowpython -m venv .venvWindows PowerShell:
.\.venv\Scripts\Activate.ps1pip install -r requirements.txtnpm installNode.js is required only for local Gemini-service mode.
Example:
GEMINI_USE_LOCAL_SERVER=true
GOOGLE_API_KEY=your_google_api_key
GEMINI_API_KEY=your_google_api_key
GEMINI_URL=http://127.0.0.1:8765/translate
GEMINI_HEALTH_URL=http://127.0.0.1:8765/health
GEMINI_PRIMARY_MODEL=gemini-2.5-flash
GEMINI_FALLBACK_MODEL=gemini-3.1-flash-lite
NVIDIA_API_KEY=your_nvidia_api_key
NVIDIA_CHAT_URL=https://integrate.api.nvidia.com/v1/chat/completions
NEMOTRON_MODEL=nvidia/nemotron-3-ultra-550b-a55bpython -m streamlit run app.pyConfigure these values under Manage app โ Settings โ Secrets:
GOOGLE_API_KEY = "your_google_api_key"
GEMINI_USE_LOCAL_SERVER = false
NVIDIA_API_KEY = "your_nvidia_api_key"The Cloud deployment then uses:
Streamlit Cloud
โ
Python Translator
โ
Google GenAI SDK
โ
Gemini
No local port 8765 or Node.js process is required.
| Priority | Provider | Role |
|---|---|---|
| 1 | Gemini 2.5 Flash | Primary translation |
| 2 | Gemini Flash-Lite | Secondary fallback |
| 3 | NVIDIA Nemotron 3 Ultra | Final reliability fallback |
Request
โ
SQLite Cache
โ MISS
Gemini 2.5 Flash
โ
Success โ Cache โ Return
Gemini 2.5 Flash
โ FAILURE
Gemini Flash-Lite
โ SUCCESS
Cache โ Return
Gemini 2.5 Flash
โ FAIL
Gemini Flash-Lite
โ FAIL
NVIDIA Nemotron 3 Ultra
โ SUCCESS
Return Translation
LinguaFlow checks the SQLite cache before making an AI request.
Translation Request
โ
Cache Lookup
โ โ
HIT MISS
โ โ
Result AI Provider
โ
Translation
โ
Save Cache
Caching reduces repeated API calls and improves response time for repeated translations.
Users can select Auto-detect as the source language. LinguaFlow uses its language detection module to determine the source language before translation.
Provider responses are validated before being accepted as successful translations.
Provider Request
โ
Response Received
โ
Validate Output
โ โ
VALID INVALID
โ โ
Return Next Provider
The application also uses retry/cooldown behavior for transient failures and moves to the next provider when a provider becomes unavailable or rate-limited.
Nemotron was independently tested with 25 unique concurrent translation requests while Gemini providers were intentionally skipped.
| Metric | Result |
|---|---|
| Total requests | 25 |
| Successful | 25 |
| Failed | 0 |
| Success rate | 100% |
| Average latency | 160.69 s |
| Fastest | 128.40 s |
| Slowest | 489.55 s |
| P50 latency | 131.02 s |
| P95 latency | 419.86 s |
| P99 latency | 489.47 s |
| Throughput | 0.05 req/s |
| Overall status | PASS |
Nemotron's measured latency is substantially higher than the normal Gemini path, supporting its role as the final fallback rather than the primary provider.
LinguaFlow is the completed project maintained for the CodeAlpha internship/project workflow.
- Built a multilingual AI translation application
- Designed a resilient multi-provider architecture
- Integrated Google Gemini models
- Integrated NVIDIA Nemotron as a final fallback
- Implemented SQLite caching
- Added automatic language detection
- Implemented retry, cooldown, and output validation
- Created a local Node.js Gemini service
- Added a separate Streamlit Cloud execution path using the Google GenAI Python SDK
- Deployed the application on Streamlit Cloud
- Maintained the project with Git and GitHub
- GitHub: https://github.com/nabinchettri18/CodeAlpha_LinguaFlow
- Live Demo: https://linguaflowtranslate.streamlit.app/
LinguaFlow is an AI-powered multilingual translation platform built with Python and Streamlit. It uses SQLite caching and a resilient multi-provider architecture with Gemini 2.5 Flash as the primary translator, Gemini Flash-Lite as a secondary fallback, and NVIDIA Nemotron 3 Ultra as the final reliability provider. The application supports automatic language detection and separate local and Streamlit Cloud execution paths.
- Built and deployed LinguaFlow, a multilingual AI translation platform using Python, Streamlit, Google Gemini, NVIDIA Nemotron, SQLite, and language detection.
- Designed a multi-provider fallback architecture that automatically switches from Gemini 2.5 Flash to Gemini Flash-Lite and Nemotron when providers fail or become unavailable.
- Implemented SQLite caching, retry handling, output validation, and provider cooldown logic to improve reliability and reduce repeated API requests.
- Deployed the application to Streamlit Cloud using the Google GenAI Python SDK while retaining a Node.js Gemini service for local development.
- Live Demo: https://linguaflowtranslate.streamlit.app/
- GitHub: https://github.com/nabinchettri18/CodeAlpha_LinguaFlow
- Nemotron is significantly slower than the normal Gemini path.
- Translation quality can vary by language and provider.
- External API availability, quotas, and rate limits can affect provider availability.
- The project is currently an internship/portfolio-scale application rather than a large public production service.
- User authentication and account management are not currently included.
- Advanced analytics and distributed infrastructure are not currently implemented.
- Provider performance dashboard
- Detailed cache analytics
- Translation history
- User accounts and authentication
- Batch translation
- PDF/DOCX translation
- Voice translation
- Public API
- Mobile application
- Browser extension
- Distributed caching
- Horizontal scaling
- Automated multilingual quality evaluation
Never publish:
- API keys
.envfiles containing secrets- Private credentials
- Service tokens
Use placeholders in documentation:
GOOGLE_API_KEY=your_google_api_key
NVIDIA_API_KEY=your_nvidia_api_keyFor Streamlit Cloud, store credentials in Secrets, not in the repository.
Multilingual Translation โ
SQLite Cache โ
Automatic Language Detection โ
Gemini Primary โ
Gemini Flash-Lite Fallback โ
Nemotron Final Fallback โ
Provider Failure Handling โ
Local Development Mode โ
Streamlit Cloud Deployment โ
GitHub Repository โ
Live Demo โ
CodeAlpha Project โ
Overall Status: STABLE / DEPLOYED
AI-powered multilingual translation with resilient provider fallback.
Created by Nabin Chettri.