I think one of the hardest parts of learning Chinese as an English speaker is that so many words have several meanings that change with context. 卷 has thirteen (!!!) definitions, from "to roll up" to "a scroll" to "to compete to an unhealthy degree." Normal dictionaries show you all thirteen, but figuring out which one actually fits is more complex., so I made Longyan to do that for whatever you highlight.
The tech side, for anyone curious:
- It runs a small model (Qwen 3.5 4B) locally with llama.cpp. - The model never writes its own definitions. It can only choose from CC-CEDICT's (an open Chinese-English dictionary), so it can't make up a meaning. - It doesn't generate the answer as text. I put the answer up to the number in the prompt and read the model's probabilities for the next token. - I patched llama.cpp so it only computes the ~67k tokens (out of 248k) that the answers can ever use, which made it faster/efficent.
For context I grew up speaking both Mandarin and English, so I spent a lot of time (9 months, this is literally my baby) making it as accurate as possible for learners. There are also ~1,000 short notes on slang and loaded words like 内卷 or 摸鱼. Those were written with Claude and checked against the dictionary.
There's an interactive demo on the website that I think is worth trying even if this isn't for you :)
It's 100% free and the whole codebase is on GitHub, including the evals and the llama.cpp patch: https://github.com/mapuchuu/longyan-reader