Skip to content

Oshi Engine 0.16.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 11:13
· 14 commits to main since this release

This release finishes milestone 0.16, Avatars from games. Her model in novel mode is now an avatar: a Live2D model, a Cubism 2 model, or Spine skeletons taken from a game. The settings UI has an Avatars view where an import plays as soon as it is dropped. Live2D became one kind of avatar, so several names changed, and the old ones keep working.

  • The settings section is [avatar], the feature avatar, the routes /v1/avatars/*, the event avatar_changed and the CLI oshi avatar. [live2d] and OSHI_LIVE2D__* are still read as avatar.*, the live2d feature counts as avatar, /v1/live2d/* answer as in 0.15 (the model list shows Live2D avatars only), live2d_changed goes out next to avatar_changed, and oshi live2d is an alias.
  • Spine import, versions 3.6 to 4.2. The version comes from the skeleton, each skeleton is paired with its atlas, and premultiplied alpha comes from the atlas or is guessed from the first page. Several skeletons make one avatar with an order, offsets and scale, so a Blue Archive lobby or Azur Lane's _B, _M and _T parts come out in the right order. Binary 3.6 and 3.7 skeletons are refused because the official web runtimes of those versions read JSON only; their JSON exports play.
  • Files are recognised by their content. The Unity suffixes .bytes, .txt, .asset and .prefab are stripped, and Live2D exports from AssetStudioMod import as they are.
  • Cubism 2 models (.model.json, .moc, .mtn) play with the legacy runtime live2d.min.js. Live2D no longer offers it for download, so the owner uploads their copy.
  • act works on Spine avatars: animations play on their own track over the idle, Blue Archive pairs are offered under one name, and a skin argument changes her outfit, which she keeps until the owner sets a default skin. While she speaks her mouth moves, with the rig's talk animation or by switching the mouth slot.
  • Touch: a tap or a pat on a touch area plays a reaction in the page at once. When the user is with her and she is awake, her next turn also gets a note about it and she answers, at most once every avatar.touch_cooldown_seconds (20) per person. The note is an engine note and never reaches memory. Route: POST /v1/novel/touch.
  • Spine avatars follow the pointer too (IK targets, then head, neck and eye bones by name). The owner can list Live2D parameters or Spine bones that follow a drag.
  • The Avatars view in the settings UI: drop a zip or a folder, watch it play, try every motion, animation, expression, outfit and touch area and write a note for each, and set following, skeletons and alpha. "Make it hers" makes it the active avatar. The runtimes are fetched or uploaded from the same view.
  • The renderers moved to web-shared/src/avatar/, so the preview draws with the same code as the novel page. web-shared/ has its own package.json now, and the UI build runs npm ci there first.

Modules in this release

Module Version Needs core Builds
browser 0.7.2 0.3.0 or newer x86_64, aarch64
novel 0.16.0 0.16.0 or newer any
settings 0.16.0 0.16.0 or newer any
telegram 0.2.4 0.2.0 or newer x86_64, aarch64
webchat 0.10.1 0.10.0 or newer any
webchat-attachments 0.5.0 0.5.0 or newer any
webchat-stickers 0.5.0 0.5.0 or newer any
webchat-themes 0.5.0 0.5.0 or newer any

settings, novel and webchat are new versions. telegram, browser and the three webchat extensions are unchanged; the store keeps the artifacts of the release that first shipped them.

Settings 0.16.0 needs core 0.16.0. The Avatars view reads /v1/avatars and the runtime routes, which an older core answers with 404, and its text comes from the engine. Novel 0.16.0 needs core 0.16.0 too: it asks only GET /v1/avatars/active and loads the runtimes from /v1/avatars/runtimes/, with no fallback to /v1/live2d/*, so on core 0.15.0 her model would never appear. Web chat 0.10.1 changes only because the shared API helper gained a function the chat does not call, so its range stays. The older parts keep working on core 0.16.0 until they update: settings 0.15.0 lists the avatar section at the end of the form, and novel 0.11.0 still shows Live2D models through the old route and event, but not Spine or Cubism 2 avatars.

Upgrading

Run oshi update apply, or in Docker pull the new image. With modules.auto_update on (the default), the next module check installs settings 0.16.0, novel 0.16.0 and web chat 0.10.1. Settings and novel wait for core 0.16.0: on an older core the store lists them as "needs core 0.16.0" and they stay on 0.15.0 and 0.11.0.

There is no database migration in this release. The Spine license acceptance and the outfit she wears are kept in the existing settings table.

On the first start, 0.16.0 moves each <data>/live2d/models/<id>/ to <data>/avatars/<id>/ and Cubism Core from <data>/live2d/core/ to <data>/runtimes/cubism-core/, then deletes <data>/live2d/. Where the new place already holds something of the same name, that one is kept. The log says "live2d files moved to avatars and runtimes". The move runs before the engine opens the database, so it has already happened when the health check runs.

The pre-update backup does not cover these files. It holds the binary, a database snapshot, oshi.toml, character/, memory/, prompts/ and the module state and settings. A rollback, whether automatic after a failed health check or by hand with oshi update restore <dir>, brings back the 0.15.0 binary and the oshi.toml with its [live2d] section, but the model files stay where 0.16.0 put them. 0.15.0 then finds no models and no Cubism Core, and novel mode shows no model. Nothing is deleted. To use them on 0.15.0, copy each <data>/avatars/<id>/ back to <data>/live2d/models/<id>/ and fetch Cubism Core again (oshi live2d core --fetch --accept-license, or the hint on the novel page). On the next start of 0.16.0 the copies in live2d/ are deleted and the ones in avatars/ are kept. Live2D models work on 0.15.0 this way; Spine and Cubism 2 avatars need 0.16.0. In Docker, also go back to the 0.15.0 image.

Settings: the first save on 0.16.0 (the settings UI, PUT /v1/settings, or oshi avatar use) writes [avatar] to oshi.toml and drops [live2d]. If both sections are in the file, [avatar] wins. OSHI_LIVE2D__* in the env file keeps working, and when an old and a new env name set the same key, OSHI_AVATAR__* wins. A live2d feature in users.default_features or on a user still counts; setting the feature on a user stores avatar and removes the old row. The one new setting is avatar.touch_cooldown_seconds (20, from 0 to 3600, env OSHI_AVATAR__TOUCH_COOLDOWN_SECONDS), and it applies to the next touch. An oshi.toml saved by 0.16.0 has no [live2d] section, so a 0.15.0 binary put back without the backup's oshi.toml ignores [avatar] and starts with no active model.

Spine runtimes are never in the repository, the release or the Docker image. The Spine Runtimes License (https://esotericsoftware.com/spine-runtimes-license) lets software use them only for people who hold their own Spine Editor license. The owner accepts it once, with the button in the Avatars view, the hint on the novel page, or oshi avatar spine --fetch --accept-license. The engine records the date and the license link, then downloads the versions the imported avatars need: one official build per version, pinned by sha256. 3.6 to 3.8 come from a fixed commit on GitHub; 4.0.31, 4.1.56 and 4.2.120 come from the npm package @esotericsoftware/spine-webgl. A download that does not match its pin is refused. Later imports fetch a missing version in the background without asking again. Offline, upload a build with oshi avatar spine --file spine-webgl.js --version 4.2 --accept-license. Cubism Core works as before and is served from /v1/avatars/runtimes/cubism-core.js now.

The engine does not decrypt game files and has no extractor. Rigs from games that pack or encrypt their assets have to be extracted with community tools first. Then upload the export as one zip, or drop its folder in the Avatars view. One zip is one avatar; a zip with both a Live2D model and Spine skeletons is refused.

If you keep your own templates in prompts/engine/: avatar_touch.md is new ("Just now: {{touches}} React to it as you would if it happened to you in person, with your line, a gesture, or both."). No existing template or model profile changed. A file in prompts/engine/ replaces only the built-in one with the same name, so there is nothing to copy.

Pages of the settings part now get script-src 'self' 'wasm-unsafe-eval', like the novel part already did, so the preview can run Cubism Core, which is WebAssembly. The keyword allows WebAssembly, not JS eval, and scripts still have to come from the same origin. Other parts keep script-src 'self'. If a reverse proxy adds its own Content-Security-Policy to the settings domain, add 'wasm-unsafe-eval' there too, or Live2D models will not draw in the preview.

Coming from 0.9.0 or earlier, the compose service rename described in the 0.10.0 notes still applies.

Downloads

  • oshi-x86_64-linux.tar.gz and oshi-aarch64-linux.tar.gz contain the oshi binary. They need glibc 2.34 or newer.
  • The module tarballs are named <id>-<version>-<target>.tar.gz. The telegram, browser and webchat extension tarballs are rebuilds of unchanged versions.
  • Each tarball has a .sha256 file, and SHA256SUMS covers all of them. store.json holds the store index entries for the modules in this release.

The Docker image is ghcr.io/oshiengine/oshi-engine:0.16.0 (also 0.16, beta, stable and latest) for amd64 and arm64.

Getting started

tar -xzf oshi-x86_64-linux.tar.gz
./oshi init
./oshi serve

With the engine running, ./oshi module install settings and ./oshi module install webchat add the settings and the chat. Open http://127.0.0.1:7420/settings and create the owner login with the setup code from oshi init. Before talking to her, set llm.providers.local.base_url and llm.chat.model in oshi.toml (or the env file) to an OpenAI-compatible server.

With Docker, docker-compose.yml starts the engine with the web chat and its extensions, novel mode and the settings; the setup code is in the log (docker compose logs oshi-engine). docker-compose-full.yml adds every module, SearXNG and the headless Chrome, with SEARXNG_SECRET set in .env.

All changes: v0.15.0...v0.16.0