dijia9723/live2d-studio
Sobre
基于 Wails 3 + React / TypeScript + live2d 的桌面 AI 伙伴工作室,支持自定义背景,特效,自定义截图
Desenvolvimento web e de aplicativosO que você pode fazer
- Live2D stage - Built-in Mao / Shizuku; mouse tracking, camera motion tracking, click actions, expressions, zoom and background switching
- Stage settings - Switches with AI chat on the right; five categories—character, background, effects, widgets, templates—conversation and stage state are preserved when switching
- Canvas ratio and templates - Adaptive plus fixed ratios 9:16, 16:9, 1:1, 4:3, 3:4, 21:9; hide surrounding buttons; save and restore local stage templates
- Free canvas widgets - Insert titles and HTML / CSS widgets, drag, resize, layer, show/hide and lock; one widget can bind multiple shared counters
Crescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- Coletando histórico
- em 15 dias
- Coletando histórico
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
OriginalLive2D Studio
A desktop AI companion studio built with Wails 3 + Go / Gin + Eino + React / TypeScript, rewritten with reference to Open-LLM-VTuber.
Features · Quick start · Guide · Project structure · Configuration & data · FAQ

The current version implements a runnable core flow: Live2D display, character persona, context-aware streaming chat, agentcore ADK tool calls, voice input and speech, image input, session persistence, and a transparent desktop pet window. See the implementation notes for coverage of the original project's features, and the product requirements for the requirement document.
Product website
MIMIKU · Live2D creator commission platform
MIMIKU is our product website and a commission marketplace for Live2D creation: browse character illustrations, Live2D models and visual design work, filter artists, riggers and visual designers by style, availability and budget, discuss quotes directly with creators and complete commissions. Live2D Studio previews, configures and drives models on your machine, while the website helps you find suitable creators and customization services.
Table of contents
- Features
- Quick start
- Guide
- Project structure
- Configuration and data
- Docker (browser version, optional)
- API and tests
- FAQ
- Third-party resources
Features
| Feature | Current behavior |
|---|---|
| Live2D stage | Built-in Mao / Shizuku; mouse tracking, camera motion tracking, click actions, expressions, zoom and background switching |
| Stage settings | Switches with AI chat on the right; five categories—character, background, effects, widgets, templates—conversation and stage state are preserved when switching |
| Canvas ratio and templates | Adaptive plus fixed ratios 9:16, 16:9, 1:1, 4:3, 3:4, 21:9; hide surrounding buttons; save and restore local stage templates |
| Free canvas widgets | Insert titles and HTML / CSS widgets, drag, resize, layer, show/hide and lock; one widget can bind multiple shared counters |
| Counter data | Manual increment/decrement, custom step, auto accumulation, pause, reset; counters and layout saved on the current device |
| Background assets | Import, apply and delete local images / GIF / MP4 / WebM / HTML; background dimming, image and video fit, video mute/loop and pause |
| Overlay effects | Sakura, starlight, fireflies, glow, snow—combinable with adjustable intensity; custom image / video overlays with blend modes |
| Character management | Import Cubism models via ZIP / folder; character config, voice, motion naming and memory; model workbench for persona, voice, motions and expressions, memory and stage |
| Text chat | OpenAI Chat Completions compatible API, SSE streaming, Markdown, stop generation |
| Coding mode | Pi coding session, read-only planning, project file editing, Git changes |
| Local Ollama | Auto-detects installed models, search by name, one-click select, shows parameter size / quantization / file size; used for connection test and streaming chat after saving |
| Agent | Optional agentcore ADK tool loop: time lookup by timezone, character expressions, arithmetic, character memory search / save, and updating the current character's name, introduction and persona. Tool execution status is saved with replies |
| Character memory | Add, edit and delete preferences and facts per character; new sessions can reference them |
| Session history | Gorm + pure-Go SQLite; auto titles, rename, search, refresh restore, delete, Markdown export |
| Image input | PNG / JPEG / WebP attachments; requires a vision-capable model |
| Watch together | Windows region selection or window picking; local OCR tracks text and page changes, providing context or cropped screenshots on demand |
| Voice input | System Web Speech or an API compatible with /audio/transcriptions; the result fills the input box |
| Voice output | Local TTS, system speech or an API compatible with /audio/speech; supports interruption and character mouth animation |
| Desktop window | Wails 3 main window, always on top, transparent desktop pet; drag by the model or transparent area, right-click to open chat, toggle speech or close the pet |
Browser speech availability depends on the browser, WebView and system. API voice mode requests microphone permission, which the user grants. Mouth animation is currently driven by playback state, not precise phoneme- or audio-energy-based lip sync.
Coding mode
Click Coding mode at the top of the Workbench to open a local project directory and start a new session. The desktop client opens a separate coding window; only one of the workbench, desktop pet and coding window is shown at a time. Click Back to workbench or close the coding window to switch back. In the browser version the interface switches within the current tab. The left side shows projects and sessions, the center shows Pi's replies and file operations, and the right side lets you view and save UTF-8 text files and review Git changes. Plan mode can browse and read project files; coding mode can create or modify files inside the project. Coding sessions are stored separately from Live2D chats. At the top of a session you can use the global default model, or pick a model for the current session from services configured in Settings → Language models.
On the left you can filter sessions by name, rename, archive and restore them, and fork a conversation together with its Pi context into an independent branch. Type @ in the prompt box or click the reference button to search and insert project file paths. On the right you can search and open files and preview the current edited content of Markdown.
The Terminal on the right starts an interactive shell in the selected project directory. At the top of a session you can create a Goal, fill in acceptance criteria and approve it to start. Goals support pause, resume and per-round progress. Sub-agents and work sessions use separate Pi contexts and can investigate code in parallel; desktop users can explicitly allow work sessions to modify files inside the project. A model can be specified when creating a work session; otherwise the character's configured model or the parent session's model settings apply.
Pi reads AGENTS.override.md, AGENTS.md, CLAUDE.md or .claude/CLAUDE.md from the project directory, taking the first non-empty file layer by layer down the directory tree. General coding instructions can be placed in coding-sessions/AGENTS.md in the app data directory.
The Pi runtime requires Node.js 22.19 or later. When running from source, install the pinned dependencies in the repository root with the command below, then re-check the runtime in coding mode.
npm --prefix server/pi-runtime ci --ignore-scripts
The default Windows build installs Pi dependencies into pi-runtime next to the program. After building with -SkipInstall, run npm --prefix pi-runtime ci --ignore-scripts in the distribution directory to install them. The runtime directory can be set via pi_runtime_dir or STUDIO_PI_RUNTIME_DIR. The workbench follows the project, session and work-panel workflow of PI-Desktop, using the Pi SDK with a Go host.
Coding plugins
Open the Plugin center at the top of coding mode to manage the three bundled plugins, search the official marketplace or import a local .piplug. Marketplace installs validate package size, SHA-256, plugin ID and version. Third-party plugins must be reviewed in the plugin center and enabled manually after installation. Packages and enable state are stored in pi-plugins/ in the app data directory.
- File manager provides creating, moving and deleting files or empty directories within the project, auto refresh, line-number references, and previews for Markdown, JSON, CSV, images, audio/video, PDF, Excel and SQLite. SQLite reads a read-only snapshot of the database file; Excel shows saved values and formula caches in worksheets.
- Browser provides web preview, address history and refresh in the right panel. Pages that refuse embedding can be opened in the system browser. Debug mode uses a separate Edge/Chromium profile and offers page screenshots and a read-only accessibility tree.
- Official enhancements provide session titles, prompt polishing, follow-up message suggestions and personal/project coding memory. Model-polished titles, draft rewriting, suggestions, and agent reading or writing of memory can each be toggled separately.
Plugin details list supported capabilities. After enabling a theme plugin, switch color schemes at the top of the coding workbench. Skills and HTTP MCP follow the plugin manifest. For local stdio MCP, review the command, arguments and environment variable bindings in the desktop plugin details, then authorize startup. Re-authorize after updating or reinstalling a plugin.
When third-party JavaScript is enabled in the desktop client, you can separately authorize the host to run it. Commands, settings and panels of authorized plugins can be opened from the top of coding mode, and work panel views switch on the right. The host provides a separate JavaScript execution process, plugin data storage, agent tools, background services and inter-plugin messaging. Plugins can read the current session and project files according to their declared permissions.
Local .piplug packages can declare the agentExtensions contribution point; after separate authorization in the desktop client, trusted Pi extensions load in interactive coding sessions. Updates or reinstalls require re-authorization. Marketplace plugins that depend on Electron-only APIs, generic plugin CDP or other unimplemented host interfaces still need adaptation.
Quick start
Download release
Download the Windows x64 ZIP from GitHub Releases, extract the whole directory and run Live2DStudio.exe. Windows WebView2 Runtime is required. The release ships with Mao and Shizuku, imported automatically on first launch.
To use AI chat, configure a service in Settings → Language models. Cloud services require your own API key; for local Ollama, pick from installed models.
Build from source
Requires Go 1.26.4+, Node.js 22.19+, npm and Windows WebView2 Runtime. The project pins Wails v3.1.0, so a normal build does not need the Wails CLI.
Run in the project root:
# Install frontend and Pi dependencies, build the UI, generate the Windows desktop app
.\scripts\build.ps1
# Launch the desktop app
.\bin\Live2DStudio.exe
Once dependencies are installed you can use .\scripts\build.ps1 -SkipInstall. The program embeds the frontend and Cubism Core. Coding mode needs Node.js on the machine to run Pi. When building from source you can place the sample runtime/ into server/data/assets/mao_pro/ and server/data/assets/shizuku/; the build script copies them to the output directory. See the third-party notes for sample downloads and licenses.
Development and testing
# Start desktop development in one command: Vite HMR + Wails desktop window (needs the wails3 CLI)
wails3 dev
# PowerShell entry for the same desktop dev flow
.\scripts\dev.ps1
# Debug the frontend in a browser only: start the headless backend, then Vite (5173)
go run -tags headless . -headless
cd frontend; npm run dev
# Build the standalone headless service
.\scripts\build.ps1 -Target server
.\bin\studio-server.exe -headless
# Open http://127.0.0.1:12393 in a browser
# Backend integration tests and static checks
cd server
go test -tags headless ./...
go vet -tags headless ./...
# Frontend type check and production build
cd ../frontend
npm run check
npm test
npm run build
The wails3 dev desktop window serves Vite development assets directly, so frontend changes hot-reload without depending on dist. You can also open the Vite address in a browser (default http://localhost:9245). The dev window's API, character models and scene assets are still provided by the Go service started for this run.
Release builds embed server/internal/webui/dist into the executable; after changing the frontend, re-run .\scripts\build.ps1 to update the release.
server/agentcore is consumed as a local Go module; both the root module and server reference it via replace, so it must be kept when building.
Guide
Douyin live mode
Select the appearing character on the left stage of the workbench, open Live mode → Douyin config on the right, enter the numeric Douyin live room ID or https://live.douyin.com/<ID>, then click Start listening. Switch to the Live messages tab at the top to view and filter comments, gifts, likes, entries and follows. When the room is offline, the app checks the live status at the configured interval.
By default each message can be handed to the AI individually. After enabling Auto reply, the workbench batches events matching the settings at an interval into one round, prioritizing question comments and gifts. Click Pause AI to keep receiving messages while pausing generation and speech. Viewers can also command motions through comments, e.g. "blink", "make a heart", "nod"; the character plays the matching motion directly and the AI adds a line, and if no matching motion exists it says so honestly. Live config independently sets the prompt, temperature, live polling, auto-reply interval, per-round event limit, reply length and the receive/auto-reply switches for each event type. The config is saved locally. AI uses the currently enabled language model in settings; subtitles, speech and motions all use the workbench stage. Auto replies continue while switching right panels. After changing the character, switch back to that session's character to resume replies.
Once a live stream is detected, received interactions and AI replies are written to the local database per session. After the stream ends or listening stops, view interaction stats and gift rankings in Live records. Click Generate AI review to analyze stats, comment samples and streamer replies with the current language model; the review is saved with the live record.
Live events are read via douyinLive; the actual event types depend on the Douyin live room and the upstream API.
Local Ollama models
The model service tabs (OpenAI, DeepSeek, Ollama, LM Studio) read that service's config from the backend every time you switch. Each service stores its own address, model, parameters, tool switch and key; only services that were never saved use backend initial values. Click Save settings to enable the current service. Current config from older databases is preserved and grouped into the matching service; unsaved form edits are kept per service on the current page and re-read from the database after refresh. When reading fails, a retry entry is shown instead of replacing saved data with defaults.
First install and start Ollama, then download a chat model suitable for your machine with ollama pull <model>. Go to Settings → Language models → Ollama; the service address defaults to http://127.0.0.1:11434 and the page automatically lists installed models. You can search models, see parameter size, quantization and file size, click a model and choose Save and test connection. You can also type the full model name (including tag) manually.
Root addresses, and addresses ending in /v1 or /api, are supported; after changing the address, read again, and the refresh button fetches newly installed models. Reading the list does not overwrite saved settings. A service that is not running, an empty model list and an invalid address each produce a corresponding message; the app does not install Ollama or download models automatically.
Model discovery uses Ollama's native /api/tags, and chat connects to the existing agentcore streaming pipeline through its OpenAI-compatible API. Local requests use placeholder credentials and do not forward saved cloud keys to Ollama. Tool calls, image recognition and reply speed depend on the chosen model and local resources.
Character memory and tools
Click a character card or the memory entry next to the workbench chat title to manage that character's memories. Under your own messages, click Save as memory to edit the prefilled content and confirm. Each character can store up to 100 memories, 300 characters each. New replies reference the 8 most recently updated.
After enabling Enable agent tools in Settings → Agent and saving, the character can also search older memories by keyword, look up time by timezone, adjust expressions and do arithmetic. Call status is shown next to assistant messages and saved with the conversation.
The agent reads the motions and native expressions that actually exist in the current model via get_character_actions, plays a specified / random motion with play_motion, or switches native model expressions with set_model_expression. You can say "what motions do you have?", "do a random motion" or "switch to exp_01". The built-in Mao exposes 7 motions and 8 native expressions, Shizuku exposes 4 motions; imported models use the same discovery flow. Missing files count as unavailable. Tools only confirm the request was sent; actual playback or loading failures are shown on the stage. Both the workbench and the desktop pet are supported.
In Character → character card → Model workbench → Motions, click "Rename motions and expressions" to name motions, native expressions and emotion presets separately, preview effects in the dialog, and save with fields left empty or after clicking "Restore default names" to revert. Config is stored per character in SQLite; stage lists, playback feedback and agent queries use the new names, while underlying asset IDs stay unchanged.
Mao and Shizuku model assets are no longer bundled into the binary; source files live in the data directory's assets/ (development: server/data/assets, copied to bin/data/assets during build). On first launch they are written to <data_dir>/models/<asset UUID>/ through the unified ZIP validation / import flow and served by /models/; upgrades only migrate old model paths while preserving character IDs, personas, names, sessions and memories, and later launches do not re-import. If no initial models are placed, import is skipped. Only the model license note remains in frontend public.
You can also say "change your name to Xingli", "change your introduction to 'a companion who loves the starry sky'", or "make the persona more humorous while keeping other settings". The update_character tool can change one or more of name, introduction and persona in one call, affecting only the current session's character. On success it persists to the character profile, the UI updates immediately, and later conversations use the new settings; unchanged fields are kept and model files are unaffected. Names are limited to 100 bytes, introductions to 200 characters and personas to 24000 bytes.

In the same workbench window, switching pages or sessions preserves each unsent draft. After a refresh, the last selected session reopens. The current input in a session is sent in full, recent history is selected by text and image transfer size, and raw messages are saved locally.
Stage management
Click Camera tracking above the workbench canvas, or authorize in Camera → Enable camera on the right. The right side shows a live mirrored preview, and tracking stays on when switching to chat or stage settings. One person in frame is recommended, with face and both shoulders visible; the character mirrors head turns, tilts, blinks, mouth opening and upper-body rotation/lean. Results depend on the parameters bound in the model; fingers and limbs are not tracked; existing lip sync still takes priority while chat speech plays. Brief tracking loss stays smooth, and sustained absence fades back to mouse control. Turning it off manually or leaving the workbench releases the camera. Web pages must be served over HTTPS or localhost. Recognition runs locally; no microphone capture, no recording or uploading of frames.
In the workbench, switch to Stage settings:
- Expressions and motions: switch emotions, play or randomly play motions, set native model expressions, or reset the character view.
- Background: click or drag in assets; images up to 15MB, videos up to 150MB. Supports PNG, JPEG, WebP, GIF, MP4, WebM; video codecs must be supported by the current WebView. Adjust cover / contain and dimming; videos are muted and looped by default.
- Custom HTML background: import a single UTF-8
.html/.htmfile (max 5MB); it is applied to the stage immediately and resizes with the canvas. Inline CSS (with animations), inline SVG,data:images and fonts are allowed; JavaScript is not executed, and external or sibling files are not loaded. You can import the HTML background example directly. - Effects: enable multiple ambient effects at once with adjustable intensity, or import your own image / GIF / video as an overlay. Transparent assets suit "Normal", black-background particle videos suit "Screen". Assets share the local media library with backgrounds.
- Widgets: add titles and HTML counter cards, configuring shared counter data, template variables, position and size. You can also insert directly from + at the top right of the canvas.
- Templates: save the current stage with a name; apply, update, rename, delete and undo the last apply/delete. Up to 20 local templates.
Above the canvas you can choose Adaptive, 9:16, 16:9, 1:1, 4:3, 3:4, 21:9. Fixed ratios display proportionally within the available area; titles and HTML content scale with smaller canvases. Click Hide buttons to hide character selection, insert, edit, zoom and bottom entries; click Show buttons or press H when not typing to restore. Ratio and visibility preferences are saved automatically.
Save a layout via Templates above the canvas or Stage settings → Templates. A template includes canvas ratio, button visibility, background and fitting, video playback switch, effects, overlays, character zoom, and all title / HTML layouts, variable bindings and counter configs. After applying, auto counters continue from the saved value without counting idle time. Templates reference local assets; if an asset is deleted, applying skips it and shows a notice.

The canvas stacks from bottom to top: background, Live2D character, ambient effects, custom overlays, title / HTML widgets, controls. Effects do not block character clicks. Background selection and effect config are saved on the current client; asset files are stored in scene-media/ in the data directory.
Switching back to AI chat keeps stage effects running and preserves the chat input and any in-flight reply.
Canvas output to OBS and Douyin Live Companion
- Install FFmpeg with
libx264and AAC and MediaMTX (tested with v1.21.4); put the executables next to the Studio program or on PATH. You can also setSTUDIO_FFMPEG_PATHandSTUDIO_MEDIAMTX_PATH. Studio starts and stops the processes needed for this output. - Open the local workbench in desktop Chrome or Edge, then click Canvas output → Start output above the canvas. Choose the current Live2D Studio tab and check "Share tab audio". To include your own voice, check Mix in microphone first. The output includes character, background, effects, widgets and live subtitles; canvas controls hide automatically during output.
- OBS: add a "Media source", uncheck "Local file", and enter
rtsp://127.0.0.1:8554/stage. If FFmpeg options are required, setrtsp_transport=tcp. Audio enters the OBS mixer with the media source. - Douyin Live Companion: if the current version supports web assets, use the "Web player" address
http://127.0.0.1:8888/stage/?muted=falseand check the player volume. You can also route through the OBS virtual camera and add the audio device that OBS monitors separately in Live Companion.
The canvas output panel also offers rtmp://127.0.0.1:1935/stage and http://127.0.0.1:8888/stage/index.m3u8. All three protocols output H.264 video and AAC audio and listen only on the local loopback address. After closing the tab, stopping browser sharing or clicking Stop output, the source stops serving. Whether system speech can be captured depends on the browser's audio output path; if system speech does not reach tab audio, switch to local TTS or a speech API in Studio.
Canvas titles and counters
Add title or counter widgets in Stage settings → Widgets. Enable "Edit layout" to drag elements, drag the bottom-right corner to resize, or nudge with the arrow keys, Shift + arrows to move faster. Click Done when finished; widgets pass mouse events through and do not interfere with character interaction. On the right you can set font size, color, alignment, opacity, position, size, layer, visibility and lock, and duplicate elements or undo the last element deletion.
Under Counter data, create a counter, choose manual or auto accumulation, and set the current value, step, reset value and accumulation interval. Auto accumulation runs on actual elapsed time, continues after a refresh or closing the page, and stops on pause. Data is saved on the current client; no external API is called.
HTML widgets accept pasted HTML / CSS or an imported .html file, and you can apply the single-counter or dual-counter examples. Each widget can bind multiple variables, and the same counter can be shared by multiple widgets; fill in a variable name at the binding and select the corresponding counter. For example, after binding count to likes and second to companionship seconds:
<div>Likes: {{count}} · Together: {{second}} s</div>
{{count.label}} shows the counter name, and {{count.raw}} shows the value without thousands separators, usable in CSS properties. Unbound variables show —. HTML styles are independent of the workbench, CSS animations are supported, scripts are not executed; counter changes update only bound nodes without re-rendering the whole widget. You can import the dual-counter widget example directly and bind count and second.

Watch together and screenshots
On Windows, when you click screenshot in the workbench, the workbench hides first. After selecting a region, click the eye icon on the screenshot toolbar; the desktop pet then takes over "Watch together" and the current conversation. Choosing a window to watch from the workbench "Watch together" menu also switches to the desktop pet first, which opens the system window picker. While watching you can ask directly "what error does this page report", or pause or end watching. Right-click the desktop pet and choose "Open workbench" to return to the current conversation. OCR runs locally; idle watching sends no model requests. Settings → Watch model lets you optionally configure a fast-understanding vision model that supports images.
Local TTS
In Character → character card → Model workbench → Voice, set the speech method to "Local TTS" to choose the low-tier AISHELL-3, mid-tier Fanchen-C or high-tier Kokoro. Adjust voice and speed, preview directly, download the WAV, then save as the character's speech config. Character voice also supports system voices and speech APIs. Microphone recognition and API connections are configured in "Settings → Voice interaction".
Requires Python 3.10–3.14, PowerShell 7 and tar. Run the following in the project root to install the inference environment and models, then click "Refresh models" in the workbench.
pwsh -File scripts/install-tts.ps1
To install a single tier, pass -Tier low, -Tier medium or -Tier high; the three tiers download roughly 32, 119 and 350 MB. Running from source reads server/tts-models/ by default; releases read tts-models/ next to configs/. Use -Destination to install elsewhere and point to it via tts_dir or STUDIO_TTS_DIR. Models and virtual environments are Git-ignored; synthesis runs offline on CPU after installation. Model sources: Sherpa-ONNX model releases.
GET /api/v1/speech/tts/modelsreturns models, voice ranges and installation status.POST /api/v1/speech/tts/synthesizesynthesizes with the model parameters in the request and returns WAV. For example{"text":"Welcome to the stream.","model":"aishell3","speaker":33,"speed":1}. Up to 1000 characters per call, speed 0.5–2×.POST /api/v1/speech/synthesizeacceptstextandcharacter_idand returns local WAV or external-service MP3 according to the character config. System speech is played by the client.
Project structure
The frontend/backend split and modular organization follow the project standard format. The only entry point is main.go in the root directory (calling server/app); native desktop and headless startup are isolated by build tags, and wails3 dev reads Taskfile.yml and build/config.yml in the root directory.
live2d-studio/
├── main.go Single entry point, calls server/app
├── go.mod / go.sum Root module, references server and agentcore via replace
├── Taskfile.yml wails3 dev build, Vite and launch tasks
├── build/config.yml wails3 dev file watching and execution config
├── Dockerfile Browser (headless) image
├── docker-compose.yml Container orchestration (publishes only on host loopback)
├── frontend/ React 19 + Vite + TypeScript frontend
│ ├── public/ favicon, Cubism Core and model license notes
│ ├── src/
│ │ ├── api/ axios / fetch wrappers and SSE streaming requests
│ │ ├── assets/ Global styles and page-level CSS
│ │ ├── components/ Organized by domain (stage, canvas, coding, etc.) plus ui/ primitives
│ │ ├── hooks/ Chat, voice, camera, live and shortcut hooks
│ │ ├── layouts/ Page layout shells
│ │ ├── lib/ Shared utilities
│ │ ├── pages/ Route pages, one directory per page
│ │ ├── router/ react-router route table
│ │ ├── store/ Zustand state and draft persistence
│ │ ├── types/ TS types matching backend APIs
│ │ └── utils/ Live2D parameter adaptation, SSE decoding, formatting, etc.
│ ├── tests/ Frontend unit tests
│ ├── package.json
│ └── vite.config.ts
├── server/ Go backend (module: server)
│ ├── app/ Startup wiring: Gin server + Wails desktop window; headless isolated by build tags
│ ├── agentcore/ Local Go module: ADK agent, memory, tools and model adapters
│ ├── configs/ YAML config templates (config.example.yaml)
│ ├── docs/ OpenAPI definitions
│ ├── internal/
│ │ ├── bootstrap/ Database, migrations, service instances, middleware and route wiring
│ │ ├── config/ Config structs, defaults, env overrides and validation
│ │ ├── middleware/ Host / Origin and local client identifier checks
│ │ ├── migrate/ Gorm auto migration
│ │ ├── model/ Gorm data models, one file per table
│ │ ├── modules/ Business modules (agent, character, coding, livemode, etc.)
│ │ ├── pkg/ Internal helpers such as unified responses
│ │ ├── router/ Module interface and /api/v1 groups
│ │ ├── tests/ API integration tests
│ │ ├── tts/ Local TTS model discovery and inference calls
│ │ └── webui/ go:embed bundled frontend assets
│ └── go.mod
├── scripts/ build.ps1, dev.ps1, install-tts.ps1
├── docs/ Requirements, implementation notes, standard format and screenshots
└── bin/ Build output and distributed configs/
The desktop single-user scenario uses SQLite and does not depend on MySQL, Redis, tenants or user login. service operates Gorm models directly, with no repository layer.
Configuration and data
You can copy server/configs/config.example.yaml to server/configs/config.yaml as needed to customize the listen address, port and data directory. Local config, the database and the models/ model library are all ignored by Git.
On desktop you can choose a directory in Settings → Data storage; it takes effect after restarting the app. The old directory keeps its existing data; select it again to continue using it. To move existing data to a new directory, quit the app, copy the whole data directory, then switch to the copy. The UI selection is stored in config.yaml.data-dir.json next to the config file, takes precedence over data_dir in YAML, and STUDIO_DATA_DIR still has the highest priority.
- Listens on
127.0.0.1:12393by default;port: 0picks a random free port. - When running from source with
go run, data defaults toserver/data/studio.db; models are imported toserver/data/models/. - Standalone distributions keep
bin/configs/and store data indata/next to the executable by default. - Packaged programs prefer
configs/next to the executable and use the same data from any working directory;-configexplicitly selects a config file. - YAML acts as initial values; UI settings are saved to SQLite. Priority: environment variables > saved settings > YAML > defaults.
- Supports
STUDIO_HOST,STUDIO_PORT,STUDIO_DATA_DIR,STUDIO_LLM_PROVIDER(openai/ollama),STUDIO_LLM_BASE_URL,STUDIO_LLM_API_KEY,STUDIO_LLM_MODEL,STUDIO_SPEECH_API_KEY. - Keys are stored only in local config or the database and are never returned by the API. Leaving a field empty in settings keeps the existing key; check "Clear" to delete it. Local files are protected by OS account permissions; no system credential store is integrated yet.
- The local API restricts Host and Origin, and write operations must carry a client identifier. The app is intended for local use.
To back up, quit the app first, then back up the entire data directory. When using cloud models, the current input, selected context, images and the character memories involved in a reply are sent to the configured model service.
Docker (browser version, optional)
docker compose up --build -d
Open http://127.0.0.1:12393. The container uses the headless build and a SQLite volume, and publishes the port only to the host loopback address. Inside the container, localhost refers to the container itself; use Docker Desktop's host.docker.internal to reach host models. The desktop pet and native window controls are available in the desktop version only. The Docker setup is provided but has not been tested against a Docker engine.
API and tests
The API prefix is /api/v1; regular responses are { code, message, data }, and write operations carry X-Studio-Client: 1. See OpenAPI.
Backend integration tests use real Gin / Gorm / Eino and a local HTTP model server, covering streaming replies, tool calls, GPT-5 parameter adaptation, failure reason persistence, desktop stream transport, config paths, asset upload/delete/type/size and video Range. Frontend tests cover SSE chunk decoding, both Live2D parameter naming schemes, and enumeration of actual model motions and expressions.
"Save and test connection" uses the same agentcore ADK streaming path as chat. GPT-5 / o series generation parameters are adapted automatically; on errors, the message shows a desensitized reason such as auth, parameters, model, rate limit or network, and you can resend directly. Microphone and speech APIs need to be verified in the corresponding environment.
FAQ
No window or a blank screen after launch Install Windows WebView2 Runtime and reopen. When building from source, make sure the frontend is built and check the port and error messages in the console log.
Port 12393 is in use
Change port in config.yaml, or set it to 0 to use a random free port; you can also override it with STUDIO_PORT.
Coding mode says the runtime is not ready
Install Node.js 22.19 or later, run npm --prefix server/pi-runtime ci --ignore-scripts in the repository root, then re-check the runtime in coding mode. For releases, install pi-runtime next to the program.
Local TTS is unavailable
Confirm that Python 3.10–3.14, PowerShell 7 and tar are installed, then run pwsh -File scripts/install-tts.ps1. For releases the model directory should be next to configs/, or point to it via tts_dir / STUDIO_TTS_DIR.
An imported Live2D model does not appear
Make sure the ZIP contains the .model3.json file and the textures and motion files it references, then refresh the character list after importing; missing files are skipped and reported on the stage.
Cloud model calls fail Check the service address, model name and key, and note the error reason next to the message (auth, parameters, rate limit or network). For local Ollama, start the service and pull the model first.
How do I back up data
Quit the app, then back up the entire data directory (default server/data/ or data/ next to a release), which contains the database, models, assets and plugin state.
Third-party resources
Sources and licenses of reference projects, Live2D sample models and Cubism Core are documented in the third-party notes. Licenses for the models and Cubism Core are independent of the app code; keep the corresponding notices when distributing.
Explore projetos relacionados
Carregando…