---
title: Beelingu
canonical_url: "https://www.modelscope.ai/studios/vanperm/Beelingu"
md_url: "https://www.modelscope.ai/studios/vanperm/Beelingu.md"
repository: vanperm/Beelingu
chinese_name: Beelingu
last_updated: 2026-11-03
sdk_type: gradio
sdk_version: 5.49.1
downloads: 0
stars: 0
---

# Beelingu

> Beelingu - An interactive demo by vanperm on ModelScope. Duolingo-style ID↔EN quiz tutor with a bee mascot. Lessons and grading by zai-org/GLM-5.2 via ModelScope API-Inference. Built with Claude Code for CAICC 2026 Track 2.

vanperm/Beelingu is an interactive demo (Studio) on ModelScope. built with gradio 5.49.1.

- **Repository**: vanperm/Beelingu
- **SDK**: gradio
- **SDK version**: 5.49.1
- **Downloads**: 0
- **Stars**: 0
- **Last updated**: 2026-11-03

Source: https://www.modelscope.ai/studios/vanperm/Beelingu

---

# 🐝 Beelingu

**Bee bilingual, 5 questions at a time.**

Beelingu is a Duolingo-style, bite-sized language quiz app with an AI tutor. You pick a direction (Indonesian → English or English → Indonesian), a level and a topic, then play a 5-question lesson with instant feedback, hearts, combo streaks, XP (called **Nectar**), synthesised sound effects, and an animated mascot called **Bili** the honeybee. After every answer the AI explains why the answer was right or wrong, and at the end there's a results screen with Nectar, accuracy, a mistakes review, and confetti for a perfect lesson.

The brand is bee-themed throughout: honey-yellow and black, a honeycomb background pattern, and a friendly honeybee mascot. Your progress (Nectar, streak, lessons, best combo, weak spots, sound preference, last settings) lives **only in your browser** via `gr.BrowserState` — nothing is stored on the server and there is no account or login.

## Features

- 5-question lessons mixing four question types: multiple choice, fill-in-the-blank, translate (typed, lenient grading), and read-and-choose.
- AI tutor (ModelScope API-Inference, model `zai-org/GLM-5.2`) generates a fresh lesson in a single call and grades typed answers; a built-in offline question bank (12 lessons) takes over if the API is unavailable or too slow.
- Instant Duolingo-style feedback panel with a one-sentence AI explanation, plus an **Ask Bili why** live call for a deeper explanation with an extra example.
- Hearts (3, lose one per wrong answer), combo streaks (🔥 from 2 in a row, Nectar bonus from ×3), floating "+Nectar" chips.
- Bili the bee mascot with idle/thinking/happy/sad/celebrate animations, a speech bubble, and synthesised sound effects (tick, correct, wrong, combo, fanfare) — no audio files.
- Confetti + fanfare on a perfect lesson.
- Local profile & progress in `gr.BrowserState`: Nectar total, daily streak (Asia/Jakarta day boundary), lessons completed, best combo, per-question-type accuracy, weak-spot detection with a one-click "want more of those?" lesson.
- Fully responsive from 320 px phones to 4K monitors and short/half-snapped windows; keyboard shortcuts (1–4 to pick options, Enter to submit/continue); respects `prefers-reduced-motion`; light and dark mode.

## Files

| File | Purpose |
|------|---------|
| `app.py` | Gradio UI, event wiring, game state machine, profile/streak logic |
| `tutor.py` | ModelScope/LLM calls, prompts, JSON parsing/validation, grading, fallback |
| `questions_bank.py` | Offline fallback lessons (12 lessons: 2 per level × direction) |
| `assets.py` | CSS, head JS (sounds, confetti, keyboard, sfx triggers), Bili SVG |
| `requirements.txt` | `gradio>=5,<6`, `openai` |
| `README.md` | This file |

## Run locally

You need Python 3.10 and pip.

```bash
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt
export MODELSCOPE_API_KEY=your_key_here     # Windows: set MODELSCOPE_API_KEY=your_key_here
python app.py
```

Then open the printed local URL (usually http://127.0.0.1:7860).

If `MODELSCOPE_API_KEY` is **not set**, the app still starts and shows a banner **"AI tutor offline: set MODELSCOPE_API_KEY"** and runs entirely from the built-in question bank.

Gradio picks up `GRADIO_SERVER_NAME` and `GRADIO_SERVER_PORT` from the environment if set. The app never uses `share=True`, GPU, model training, databases, or accounts.

## Deploy to ModelScope Studio

1. Upload all files **except** `.venv/`, `.claude/`, and `__pycache__/` (do not upload `.env` either — use Secrets instead).
2. Choose the **Gradio** framework, free **CPU** instance, **Python 3.10**.
3. Under **Secrets**, add `MODELSCOPE_API_KEY` with your ModelScope API-Inference key.
4. (Recommended) Under **Secrets**, add `BEELINGU_SECRET` with a random, stable string (e.g. a long hex value). This is the encryption secret for `gr.BrowserState`, which stores each player's progress in their own browser. Without a stable secret, every server restart or redeploy re-encrypts with a new key and **wipes every player's saved progress** ("Malformed UTF-8 data" in the browser console). Use the **same value across redeploys** so existing players keep their progress. If omitted, a fixed local-dev default is used (fine for local play, not for production).
5. Deploy. The entry point is `app.py` (`demo.launch()`).

## The model

The AI tutor calls the **ModelScope API-Inference** endpoint (OpenAI-compatible, base URL `https://api-inference.modelscope.ai/v1`) with model **`zai-org/GLM-5.2`**.

The model id is defined in one constant, `MODEL_ID`, at the top of `tutor.py`. To switch to another approved model, change that one line to one of:

- `zai-org/GLM-5.2` (default)
- `deepseek-ai/DeepSeek-V4-Pro-0813`
- `stepfun-ai/Step-3.5-Flash`
- `Qwen/Qwen3.8-27B`

No other model or provider is supported. The API key is read **only** from the environment variable `MODELSCOPE_API_KEY` and never appears in any file.

## How it was built

Beelingu was built with **Claude Code** running **`zai-org/GLM-5.2`** through the **ModelScope API-Inference** endpoint (OpenAI-compatible). The app, prompts, offline question bank, and Bili mascot were iterated over several prompt rounds: an initial end-to-end build, then four fix rounds hardening visibility/state/CSS edge cases, and a final polish round that added a visible loading state, faster generation (disabling the model's thinking block and capping `max_tokens`), a deeper "Ask Bili why" call with caching, a 💡 Hint button, and small results-screen fixes.

The model id lives in one constant, `MODEL_ID`, at the top of `tutor.py`. To switch to another approved model, change that one line to one of:

- `zai-org/GLM-5.2` (default)
- `deepseek-ai/DeepSeek-V4-Pro-0813`
- `stepfun-ai/Step-3.5-Flash`
- `Qwen/Qwen3.8-27B`

and redeploy — no other code changes are needed.

## Environment variables

| Variable | Required | Purpose |
|----------|----------|---------|
| `MODELSCOPE_API_KEY` | No | ModelScope API-Inference token. If absent, the app runs in offline mode from the question bank. |
| `BEELINGU_SECRET` | No (recommended in production) | Stable encryption secret for `gr.BrowserState` (per-browser saved progress). Set the **same value** across redeploys on ModelScope Studio; otherwise each restart re-encrypts and wipes every player's progress. Defaults to a fixed local-dev string if unset. |
| `GRADIO_SERVER_NAME` | No | Host Gradio binds to, if set. |
| `GRADIO_SERVER_PORT` | No | Port Gradio binds to, if set. |
