--- title: Vibeon Translator API emoji: ๐ŸŒ colorFrom: blue colorTo: indigo sdk: docker app_port: 7860 pinned: false license: apache-2.0 short_description: 200+ language translation with STT, TTS and OCR --- # Vibeon Translator API **200+ languages ยท Speech-to-Text ยท Text-to-Speech ยท Document & Image OCR** FastAPI-based translation microservice built for the Vibeon social platform. --- ## Quick Demo ### Translate text ```bash curl -X POST https://.hf.space/api/translate/text \ -H "Content-Type: application/json" \ -d '{"text": "Hello, how are you?", "target_language": "rw"}' ``` ### Detect language ```bash curl -X POST https://.hf.space/api/translate/detect-language \ -H "Content-Type: application/json" \ -d '{"text": "Muraho, amakuru?"}' ``` ### List supported languages ```bash curl https://.hf.space/api/languages ``` ### Health check ```bash curl https://.hf.space/health ``` --- ## Interactive Docs Visit `https://.hf.space/docs` for full Swagger UI. --- ## API Endpoints | Method | Path | Description | |--------|------|-------------| | POST | `/api/translate/text` | Translate text (single) | | POST | `/api/translate/batch` | Translate up to 100 items | | POST | `/api/translate/detect-language` | Language detection | | POST | `/api/voice/stt` | Speech โ†’ text (Whisper base) | | POST | `/api/voice/tts` | Text โ†’ speech (gTTS / Edge-TTS) | | POST | `/api/multimodal/translate/image` | Image OCR + translate | | POST | `/api/multimodal/translate/document` | PDF/DOCX translate | | POST | `/api/social/translate` | Social content translation | | GET | `/api/languages` | All 200+ supported languages | | GET | `/health` | Service health check | | GET | `/docs` | Swagger UI | --- ## Models Used | Model | Purpose | Size | |-------|---------|------| | `facebook/nllb-200-distilled-600M` | Translation (200+ languages) | ~2.5 GB | | `openai/whisper-base` | Speech-to-text | ~150 MB | | gTTS / Edge-TTS | Text-to-speech | API-based | | Tesseract OCR | Image text extraction | System | --- ## Configuration Set these as **Space Secrets** (Settings โ†’ Variables and secrets): | Secret | Required | Description | |--------|----------|-------------| | `DATABASE_URL` | โœ… Yes | PostgreSQL URL (get free DB at [neon.tech](https://neon.tech)) | | `SECRET_KEY` | โœ… Yes | JWT signing key (`openssl rand -hex 32`) | | `CORS_ORIGINS` | Optional | Default: `["*"]` | | `SENTRY_DSN` | Optional | Error tracking | --- ## Tech Stack - **FastAPI** 0.104 + Uvicorn - **HuggingFace Transformers** (NLLB-200) - **OpenAI Whisper** (base) - **PostgreSQL** via SQLAlchemy - **DiskCache** (Redis-free fallback)