Skip to main content

otaku — a roleplay terminal client

PyPI License: MIT Python 3.14+ Platforms

Stories that branch and grow their own lore — on your machine, with optional at-rest encryption.

otaku demo

What it is

Otaku is an attempt to build a terminal alternative to SillyTavern (ST), with a focus on:

  • transparency about what is sent to the LLM (the /context command),
  • automatic incremental summaries that replace the middle of the chat to save context space (browse and edit them with the /lore command),
  • automatic character extraction from the chat (the /cast command),
  • minimal to no under-the-hood prompt injection.

How the otaku workflow differs from ST (partly limitations of the current version, partly intentional):

  • no pre-created character cards, worlds, lore, etc. — everything is inferred and extracted from the chat;
  • however, you can set up your world or characters manually in the system message (the /system command).

Other features:

  • importing chats from ST, with scene and character extraction,
  • importing a plain text file, parsed into turns, with scene and character extraction,
  • loading and unloading models in Ollama and oMLX directly from the app,
  • automatic daily backups,
  • optional encryption,
  • and more.

Install

# either with uv
uv tool install otaku

# or via Homebrew
brew install enclavum/tap/otaku

Get started

otaku

On first start, you choose a provider and a model: otaku automatically detects local installations of Ollama, oMLX, and KoboldCpp and lets you pick from their models. After you've chosen, you land at the prompt. If nothing is running yet, otaku opens anyway — pick a model later with /model.

To give you an idea of the features and what play looks like, on first start a sample story is imported, and you land right in the middle of it. You can explore it with the /lore, /cast, and /context commands.

From there, you either start your own story with the /new command or import an ST chat with /import. Importing takes time, because it doesn't only import the messages — it also extracts characters and scenes from them (more on that below). You can also import a plain text file the same way; it will be split into messages. The format is detected from the file, and the extension has to match: .jsonl for an ST chat, .txt for plain text, .md for an otaku export.

/import ~/stories/the-long-road.md  # an otaku export, memory included
/import ~/chats/my-st-chat.jsonl    # a SillyTavern chat
/import ~/drafts/story.txt          # plain text, split into turns

Features

The play, stories, and branches

You send messages as usual, as your persona; the LLM infers which character to play from the dialogue. There are three helper commands — /you, /me, and /ooc — which only frame your prompt with minimal injections like "you play as …" (you can configure these templates in ~/.otaku/configs/prompts.toml).

During play, you can /undo and /regen the last message. You can branch a new version of the story with /fork, or start a new story with /new. The /stories command lists your stories and their messages; you can switch to a previously played story from there, and resume it from any message. If you don't like an earlier message, you can also edit it in the /stories view.

Summaries and character extraction

After you've sent around 50 messages, a summary pass starts automatically in the background once you've been idle for 5 minutes, so it doesn't disturb your roleplay. You can also run it on demand with /extract. You'll see a notification and its progress in the status bar, and you can keep playing meanwhile — replies will just be slower while it runs. Once it completes, you can browse and edit the extracted summaries and characters with the /lore and /cast commands. Summaries are editable, so you can correct them however you like.

How the context is constructed

The summaries only kick in once you have more than around 200 messages in the chat. The first 20 and the last ~150 messages (both configurable) are always sent as-is, to preserve maximum detail and your prose style; everything in between is replaced with scene summaries. So even though summaries may exist up to the latest message, only the older ones are actually used.

Warnings, limitations, and planned features

This is only the second release, and an alpha. For now, otaku works with local LLMs only. Planned for the next version:

  • Properly wire the characters and lore into the roleplay context, alongside the scene summaries. Even though they are extracted, they are not yet injected anywhere into the prompt — they are only used to build each character's journal for subsequent scenes. How to use them better is still an open question.
  • Implement proper multi-chats, with different characters optionally backed by different LLMs.
  • Add support for cloud APIs (OpenRouter, OpenAI, and any other OpenAI-compatible endpoint).

Usage

Type to play — your words go to the model verbatim, and the reply streams back as markdown. Around that:

PROMPT     your character speaks or acts             /lore      browse and edit the memory
/undo      take back the last exchange (Ctrl+U)      /cast      the same browser, on the cast
/regen     a fresh take on the reply (Ctrl+R)        /extract   run the summary pass now
/stories   browse and resume (Ctrl+T)                /context   preview the next request
/model     switch models mid-story (Ctrl+O)          /help      everything else

Configuration

Everything lives in the state dir, ~/.otaku by default:

  • configs/config.toml — yours: providers, context window, extraction thresholds, encryption, backups. Written once on first run, never touched again.
  • configs/prompts.toml — every template otaku ever sends, editable.
  • configs/state.toml, configs/models.toml — the app's own memory of your session and per-model settings.

Set OTAKU_CONFIG_DIR to run a completely separate environment: OTAKU_CONFIG_DIR=~/.otaku-alt otaku.

Privacy and storage

Stories live in a local SQLite database and never leave your machine — otaku talks only to the model servers you configure. Encryption at rest is one config switch away (AES-256-GCM, sealed client-side): the key can live in your OS keychain, come from a command of your choice (a password manager, a hardware token), derive from a passphrase, or sit on disk. The request log is sealed with the same cipher; the system and error logs are content-free by contract. Daily database backups are kept in the state dir. Details in SECURITY.md.

Provider support

Backend Autodetected Load / unload
Ollama yes yes
oMLX yes yes
KoboldCpp yes served as-is

Requirements

  • macOS or Linux, and a terminal
  • Python 3.14+ (installed automatically by uv tool install)
  • a local model server: Ollama, oMLX, or KoboldCpp

Contributing

See CONTRIBUTING.md — a small, focused project; contributions that keep it sharp are very welcome.

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otaku-0.2.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otaku-0.2.0-py3-none-any.whl (171.4 kB view details)

Uploaded Python 3

File details

Details for the file otaku-0.2.0.tar.gz.

File metadata

  • Download URL: otaku-0.2.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for otaku-0.2.0.tar.gz
Algorithm Hash digest
SHA256 65c8b6fcd7189b16406ecce78f5f140535fd6d5ef5c22477b2a6c17b6f7ee7f2
MD5 31f467ffcd24a3b120c144f106f71bda
BLAKE2b-256 aa6965e0732b6b95db04f7da0278ad2011428326de748d8f046130fbc7d3d901

See more details on using hashes here.

File details

Details for the file otaku-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: otaku-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 171.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for otaku-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f091b94e03097abda1d76338b08edd2a9c1c0a8b01f23dc8370e1151ab349cee
MD5 c034831c3324ed0aa76d1372671c10c6
BLAKE2b-256 792355d4895a05607d2b9fdd7bf59ca9993bed5e6fab1ce1b9a17844944e40b4

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page