Raj000/news_gloss_local_llm
News in Your Language
A Gradio app that clusters English news into story groups, simplifies each story, translates it into Indian languages, and reads it aloud.
Runtime Secrets
CURRENTS_API_KEY: Currents API key for live English news.HF_TOKEN: Hugging Face token for Inference Providers.
Local Setup
Create a local environment file from the provided template:
cp .env.example .envEdit .env and replace the two placeholder secret values. The app loads this file automatically. Existing shell or deployment environment variables take priority over values in .env.
Install and run with uv:
uv venv --python 3.12
uv pip install -r requirements.txt
uv run python app.pyThe .env file is ignored by Git and must never be committed.
Hugging Face Spaces Configuration
Do not upload .env to a Space. In the Space repository, open Settings → Variables and secrets and add:
- Secrets:
CURRENTS_API_KEY(TheHF_TOKENsecret is no longer needed since we use a local LLM). - Variables:
CMAKE_ARGS,DISABLE_PREGEN,FETCH_INTERVAL_MIN,TOP_N_PREGEN,MAX_ARTICLES,SUPPORTED_LANGS, andCACHE_DIR
CRITICAL DEPLOYMENT VARIABLES:
CMAKE_ARGS: If you deploy to a Free CPU space, you MUST set this to-DGGML_CUDA=offto force pure CPU compilation and prevent CUDA crash errors. If deploying to ZeroGPU, omit this variable entirely!DISABLE_PREGEN: If you deploy to a ZeroGPU space, you MUST set this to1to disable background thread LLM generation, or the Space will crash. If deploying to Free CPU, set this to0or omit it so background generation works!
The optional variables can be omitted to use the defaults below.
Optional Variables
HF_MODEL: defaults toQwen/Qwen3-8BHF_PROVIDER: defaults toautoHF_MODEL_SUFFIX: optional provider policy suffixFETCH_INTERVAL_MIN: defaults to30TOP_N_PREGEN: defaults to20CACHE_DIR: defaults to.cacheSUPPORTED_LANGS: defaults tohi,mr,ta,te,bn,kn,mlMAX_ARTICLES: defaults to20; requests are always capped at the Currents free-tier limit of50
Notes
We use gTTS to synthesize the translated news bulletins into audio for all supported Indian languages.
