跪拜 Guibai
← All articles
Frontend · Artificial Intelligence

A Tampermonkey Script Gives Any LLM a 3D Avatar on Every Webpage

By 石小石Orz ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most LLM interfaces are still text boxes. This script shows how cheaply a multimodal, embodied agent layer can be bolted onto any existing model and deployed across the entire web, turning a reasoning engine into a persistent, interruptible presence that works on commodity hardware.

Summary

A frontend developer has released a Tampermonkey script that places a fully interactive 3D avatar onto every webpage a user visits. The avatar is rendered by the Mofa Nebula embodied driving SDK, which handles sub-500ms voice synthesis, facial expressions, and body movements on low-cost hardware without a game engine. The script connects to any LLM—DeepSeek is built in by default—and streams the model's text output directly to the avatar's speech engine, so the character begins speaking before the full response is generated.

Voice input is also supported through a third-party ASR service, creating a full bidirectional conversation loop. Avatar appearance, scene, and voice can be hot-swapped from the Mofa Nebula console with zero code changes. The entire setup requires only a browser extension, an SDK key, and optionally a personal LLM API key.

The project treats the LLM as the brain, the SDK as the body and voice, and the userscript as the delivery mechanism. The result is an AI companion that follows a user across domains rather than being trapped inside a single chat window.

Takeaways
Installing a single Tampermonkey script places a 3D avatar panel on every webpage, with no per-site integration required.
The Mofa Nebula SDK renders the avatar, handles TTS, and syncs expressions and gestures at under 500ms latency on low-cost chips.
Avatar appearance, scene, and voice are hot-swappable from the cloud console; the script picks up changes instantly with no redeployment.
LLM streaming output is fed to the avatar in segments, so speech begins before the full text response finishes.
Voice input runs through a third-party ASR service, creating a full speech-to-speech pipeline: ASR → LLM → SDK speech.
A built-in DeepSeek model works out of the box; users can swap in their own API key for any compatible LLM.
The SDK exposes explicit state methods—idle, listen, think, speak—so the avatar's posture reflects the conversation phase.
Conclusions

The architecture cleanly separates concerns: the LLM is just a text generator, the SDK is a pure expressiveness layer, and the userscript is a zero-friction distribution channel. None of the three pieces needs to know about the others.

Hot-swapping the avatar from a cloud console without touching code is a small detail that removes the usual friction of redeploying frontend assets, making non-technical iteration on the character's look and feel trivial.

Streaming TTS that starts mid-generation is the feature that makes the interaction feel conversational rather than like a buffered playback, and it requires almost no extra work beyond segmenting the LLM's stream.

Concepts & terms
Embodied Interaction Intelligence
An AI paradigm where a model is given a visual avatar with synchronized speech, facial expressions, and gestures, enabling real-time, bidirectional interaction beyond text.
Mofa Nebula Embodied Driving SDK
A proprietary SDK that renders 3D digital humans in a browser, handling TTS, emotion parsing, expression generation, and end-side rendering without a traditional game engine.
Tampermonkey (Oil Monkey)
A browser extension that injects user-defined JavaScript into any webpage, commonly used to modify or enhance page behavior without building a full browser extension.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗