App

Using Ohanashi

Ohanashi (おはなし, “a chat”; ohanashi-ollama) is a web app for chatting in the browser with the LLMs that Ollama runs on your own machine. The server is written in する and builds into a single executable. Conversations are kept in a local SQLite file, so they never leave your machine. The app’s screens are in Japanese.

💬 Conversations and threads📒 Memo🛠 Coding mode🧠 Model book📜 Rules📎 Images and PDFs🌐 Web💻 Sandbox📄 Word and PDF🐙 GitHub🔔 Notifications

01Install and run

You need:

terminal
# on macOS with Homebrew’s sqlite and OpenSSL, first:
$ export PKG_CONFIG_PATH="$(brew --prefix sqlite)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig"

$ git clone https://github.com/suru-lang/ohanashi-ollama
$ cd ohanashi-ollama
$ kumu 実行

Then open http://localhost:8080/ in your browser. The app reads its screen files from 画面/ in the current folder, so start it in this folder.

The options you will use most. The README lists the rest.

OptionMeaningDefault
--ollama URLWhere Ollama isOLLAMA_HOST, else http://localhost:11434
--port PORTPort of the web page8080
--listen ADDRESSAddress to listen on127.0.0.1 (this machine only)
--db FILESQLite file for conversationsohanashi.db
--searxng URLSearXNG for web searchSEARXNG_URL, else none
terminal
$ kumu 実行 -- --port 9000 --db ~/ohanashi.db
$ ./起動.sh --watch 60      # rebuild and restart when new commits arrive

When you run it with 起動.sh, the ⚙ panel gets a “🔄 update and restart” button. With --watch SECONDS, it checks for new commits that often and, if there are any, runs git pull, kumu 作る and restarts the app. If the rebuild fails, the old app keeps running.

02Conversations and threads

Start a conversation or open an earlier one from the list on the left. Answers stream in as they are written, and “止める” (stop) ends one early. Code and tables in the Markdown are formatted, and “写す” copies a code block.

03Modes and the model book

Press “💬 会話” (conversation) in the heading to switch to “🛠 コーディング” (coding). Coding mode attaches the rules for coding and turns on the “💻 sandbox”. A new conversation starts in the mode you chose last.

The “🧠 model book” in ⚙ lists the size, quantization, context length and capabilities (🔧 tools, 👁 images) of each model in Ollama. When web search is available, the app has a model look up the other models and records their traits and scores (code, conversation, Japanese, reasoning; 0 to 5). A new conversation picks a model that scores well for its mode. You can edit what was found with “直す”.

04Rules

Save what you want the model to follow, such as “rules for writing code”, as a named “📜 rule”, and attach it to conversations in ⚙. It is like CLAUDE.md for Claude Code. Rules are read for every answer, so editing one changes every conversation it is attached to. A rule can be attached always, only in coding mode, or only in conversation mode.

A repository can carry its own rules in a file. When the “💻 sandbox” or “🐙 GitHub” is on, the app looks in the repositories in the work folder for OHANASHI.md, then AGENTS.md, then CLAUDE.md, and gives the first one it finds to the model.

OHANASHI.md
- Run the tests with `kumu 試験` and push only when they pass
- Write comments and commit messages in Japanese

05Images and PDFs

Drop files on the page, paste them into the input (Ctrl+V, ⌘V), or pick them with 📎 to attach them to a question.

06Web search

With “🌐 ウェブ” on, the model searches the web before it answers and lists its sources at the end. You need your own SearXNG (SEARXNG_URL) or Ollama’s web search API (OLLAMA_API_KEY). The search words leave your machine, so leave the button off for questions that should stay local.

07Sandbox and documents

With Docker running, you can turn on the “💻 sandbox”. The model writes and runs code in a Docker container for the conversation and checks the results before it answers (it needs a model that can use tools). /work in the container is 作業/NUMBER on your machine, so you can open what it makes. The container starts with no network; tick “💻 砂場からインターネットにつなぐ” in ⚙ for conversations that need pip and the like.

Build the document image and you can ask for “a Word report of what we discussed” or “make it a PDF”. The model writes the content in Markdown and turns it into Word or PDF in the sandbox. Files made during an answer appear as links like “📄 報告.docx (24KB)” at its end; earlier files are under “📁 作業フォルダ” in ⚙.

terminal
$ docker build -t ohanashi-sandbox 砂場    # includes Japanese fonts; restart the app afterwards
Note: The commands the model runs are not confirmed first. Do not keep important files in the work folder.

08GitHub

Put a GitHub key (a fine-grained personal access token) in the environment variable GITHUB_TOKEN and start the app.

terminal
$ GITHUB_TOKEN=github_pat_… kumu 実行

Add repositories to a conversation under “GitHub のリポジトリ” in ⚙, each as read-only (読むだけ) or read-write (読み書き). With “🐙 GitHub” on, the model reads the repository’s settings, files, issues and pull requests before it answers.

Tip: Small models tend to write “I pushed it” without calling the tool. Name the tool and the branch (“push to the branch ohanashi/fix-typo with the github_push tool”), ask for clone, fix, push and pull request one at a time, and start a new thread for each task.

Give the key access only to the repositories you use: Contents, Issues and Pull requests as read-only for reading, or read and write for writing.

09Phones and notifications

To open it from another device, put Tailscale Serve in front. It is then at https://MACHINE.TAILNET.ts.net/, only for machines on your tailnet, with a certificate from Tailscale. Turn on MagicDNS and HTTPS Certificates under DNS in the Tailscale admin console first.

terminal
$ kumu 実行                     # keep the default --listen 127.0.0.1
$ tailscale serve --bg 8080     # stop with: tailscale serve --https=443 off

If an answer finishes while you are in another tab, the tab title gets “✅” (or “⚠️” on failure). Tick “🔔 見ていない間に答えが終わったら通知する” in ⚙ to get a browser notification too; clicking it takes you back to the thread. Browser notifications work only on localhost or https.

Note: With --listen 0.0.0.0, anyone on the same network can read your conversations. If you use Tailscale, Tailscale Serve is the safer way.

10Going further

The Ohanashi server is about 4,000 lines of する. HTTP, WebSocket, SQLite, GitHub and Ollama each live in their own する library, so you can use them in your own apps.