Use the reMarkable2 as an interface to vision-LLMs (ChatGPT, Claude, Gemini). Ghost in the machine!
Use the reMarkable2 as an interface to vision-LLMs (ChatGPT, Claude, Gemini). Ghost in the machine!
An experiment for the reMarkable that watches what you write and, when prompted either with a gesture or some on-screen content, can write back to the screen. This is an exploration of various interactions through this handwriting+screen medium.
I wrote the handwritten prompt, GPT-4o drew the Chihuahua!!!
You need an OPENAI_API_KEY (or similar for other models) environment variable set. I did this by adding it to my ~/.bashrc file on the remarkable:
# In the remarkable's ~/.bashrc or before you run ghostwriter, set one or more of your keys
export OPENAI_API_KEY=your-key-here
export ANTHROPIC_API_KEY=your-key-here
export GOOGLE_API_KEY=your-key-hereInstall by getting the binary to your remarkable. On your not-remarkable (ie. your laptop):
# For the reMarkable2
wget -O ghostwriter https://github.com/awwaiid/ghostwriter/releases/latest/download/ghostwriter-rm2
# For the reMarkable Paper Pro
wget -O ghostwriter https://github.com/awwaiid/ghostwriter/releases/latest/download/ghostwriter-rmpp
# Replace this ip address with your remarkable ip address
scp ghostwriter [email protected]:Then you have to ssh over and run it. Here is how to install and run (run these on the remarkable):
# One time -- make it executable after the initial copy
chmod +x ./ghostwriter
./ghostwriter --help # Get the options and see that it runs at allFirst you need to start ghostwriter on the reMarkable. SSH into your remarkable and run:
# Use the defaults, including claude-sonnet-4-0
./ghostwriter
# Use ChatGPT with the gpt-4o-mini model
./ghostwriter --model gpt-4o-miniDraw some stuff on your screen, and then trigger the assistant by touching/tapping the upper-right corner with your finger. In the ssh session you'll see other touch-detections and there is a log of what happens while it is processing. You should see some dots drawn during processing and then a typewritten or drawn response!
Models & Engines:
--model MODEL - Model to use (default: claude-sonnet-4-0)--engine ENGINE - Engine: openai, anthropic, google (auto-detected from model)--engine-api-key KEY - API key (or use env vars)--engine-base-url URL - Custom API base URLBehavior:
--prompt PROMPT - Prompt file to use (default: general.json)--trigger-corner CORNER - Touch trigger corner: UR, UL, LR, LL (default: UR)Tools:
--no-svg - Disable SVG drawing tool--no-keyboard - Disable text output--thinking - Enable model thinking (Anthropic)--web-search - Enable web search (Anthropic)Testing/Debug/Experiments:
--log-level LEVEL - Set log level (info, debug, trace)--no-loop - Run once and exit--input-png FILE - Use PNG file instead of screenshot--output-file FILE - Save output to file--save-screenshot FILE - Save screenshot--save-bitmap FILE - Save rendered output--no-submit - Don't submit to model--no-draw - Don't draw output--no-trigger - Disable touch trigger--apply-segmentation - Add image segmentation for spatial awarenessTo run in the background, start it (on the remarkable) with nohup:
nohup ./ghostwriter --model gpt-4o-mini &(TODO: figure out how to run it on boot!)
I've been developing in Ubuntu, but did get it working in OSX. Generally it goes (1) install dependencies, (2) build locally but cross-compile for the reMarkable, (3) scp it over and try it out.
sudo apt-get install gcc-arm-linux-gnueabihfbrew install arm-linux-gnueabihf-binutilscargo install cross --git https://github.com/cross-rs/crossrustup target add armv7-unknown-linux-gnueabihf aarch64-unknown-linux-gnucross build --release --target=armv7-unknown-linux-gnueabihfscp target/armv7-unknown-linux-gnueabihf/release/ghostwriter root@remarkable:cross build --release --target=aarch64-unknown-linux-gnuscp target/aarch64-unknown-linux-gnu/release/ghostwriter root@remarkable:build.sh./build.sh to build and send to my rm2./build.sh rmpp to build and send to my rmppMeanwhile I have another terminal where I have ssh'd to the remarkable. I ctrl-C the current running ghostwriter there, then on my host laptop I run my build script, and then back on the remarkable shell I run ghostwriter again.
When I want to do a build for others, I tag main with like v2026.09.21-01 and that kicks off a github action that creates the latest release.
2024-10-06 - Bootstrapping
2024-10-07 - Loops are the stuff of souls
2024-10-10 - Initial virtual keyboard setup
2024-10-20 - Text output and other modes
./ghostwriter text-assist mode, uses a virtual keyboard to respond!2024-10-21 - Binary release build
2024-10-23 - Code shuffle
tools so that it can contextually give back an SVG or text or start to trigger external scripts, like for TODO list management2024-11-02 - Tool Time
2024-11-07 - Claude! (Anthropic)
2024-11-22 - Manual Evaluations
./build.sh local)2024-12-02 - Initial segmenter
With a LOT of help from claude/copilot I have added a basic image segmenting step
This does some basic segmenting and then gives the segment coordinates to the Vision-LLM to consider
Only hooked it up with claude for now, need to merge those two models
... It helps with putting X in boxes a LOT!!
Need to get some automation around the evaluations
The segmenter has to be explicitly enabled with --apply-segmentation and it assumes that you have either --input-png or --save-screenshot because it (dumbly) re-parses the png file
OMG this is the first time that the math prompt got even close to putting the answer where I want! It has been getting it right, but usually types the 10 with the keyboard or places it somewhere wrong. This time it actually put it where it should be!
2024-12-15 - Engine Unification
prompts/ directory) and unified, so each engine does whatever it needs to adjust for its own APIprompts/ files are both bundled in the executable AND overridable at runtime with a local directory, but I haven't verified that much2024-12-18 - System Upgrade Panic
james.json and go in and add "Your name is James" into the prompt. Then copy that to your reMarkable./remarkable --prompt james.json and it has a locally modified prompt!2024-12-19 -- Not Quite Local
On the internet they suggested a local-network Vision-LLM mode
Ollama has that! So I tried...
But it says that llama3.2-vision doesn't have tools :(
But Groq llama-3.2 does!
... but it is not very good at tic-tac-toe (this is the 90b). Though it is very fast!
Oops! I forgot to turn on segmentation. Here it is with that enabled which should give a better sense of space...
Here are 3 runs from claude in contrast
Well. The new ENV is OPENAI_BASE_URL, so `OPENAI_BASE_URL=https://api.groq.com/openai ./ghostwriter --engine
No open issues yet, or sync has not completed.