Skip to content

armgit / PS5LM

Public Imported from GitHub
0

llama.cpp on a jailbroken PS5: run any GGUF model natively on the console, starting with Qwen 3.8

README: PS5LM, with decision models powered by Ollaya; docs/BUILDING.md

Mert Cobanovbd9f34bb2737
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a7d015f..bf9c437 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,32 @@ v0.1.x are the upstream payload releases by cobanov.
## [Unreleased]
+### Added
+- A new screen, designed from scratch: **Home** (the model, its speed, and every request and its
+ answer streaming as it happens), **Models** (on this PS5, suggested models measured on the console,
+ Hugging Face search and downloads), **API** (the endpoints and an example) and **Settings** (with
+ the logs under Diagnostics). Manrope type, interface sounds from PocketVibe, and a full-screen
+ splash while the app restarts for a model.
+- **Decision models**: llama.cpp's `/v1/systemone` (TypeSafe's API, the one Ollaya serves) with d1,
+ d1 Omni, Clef, OpenJev and others. The planner gives them a 2048-token batch and a 4k context.
+- MiniCPM-V 4.7's image projector, and the other models of llama.cpp 04f7226.
+- `/data/PS5LM/env.txt`: driver and ggml switches set before the GPU opens, for measuring.
+
+### Changed
+- The app is **PS5LM** under its own title ID, **PPSA99575**, with a new icon and home screen
+ background. PS5LM Plus (PPSA99581) stays @abhi245y's app.
+- llama.cpp moves to 04f7226; RADV carries three of PS5CEMU-HAR's driver patches (`patches/mesa`),
+ among them freed buffers waiting for the GPU.
+- Models with an image projector get a 2048-token ubatch, so images are no longer cut to 64 tokens.
+
+### Fixed
+- A float in any request (`"temperature": 0.7`) stopped the server: the console's `localeconv()`
+ reports an empty decimal point. The app now gives the C locale's.
+- An image projector llama.cpp cannot read no longer stops the server: the app restarts once and
+ loads the model text only.
+- `scripts/build-app.sh` fetches the OpenGL SDK through ps5-homebrew-ui's script, creates `build/`,
+ and no longer needs ImageMagick.
+
## [0.8.3] - 2026-10-13
### Changed
diff --git a/README.md b/README.md
index 927864c..892c7a0 100644
--- a/README.md
+++ b/README.md
@@ -1,175 +1,146 @@
-<p align="center"><img src="docs/media/app/icon.png" width="128" alt="PS5LM Plus app icon"></p>
-
-# PS5LM Plus
-
-**llama.cpp on a jailbroken PlayStation 5, on its GPU.** A native app that runs GGUF language models on the console itself, with a dashboard on the TV, a model store, and a chat and OpenAI-compatible API for every device on your network.
-
-> **This is a fork.** PS5LM was created by **[Mert Cobanov](https://github.com/cobanov)** ([cobanov/PS5LM](https://github.com/cobanov/PS5LM), [ps5lm.cobanov.dev](https://ps5lm.cobanov.dev)): the llama.cpp port, the payload, its model library and the research all come from there. This fork, by me, adds the **native GPU app**, named PS5LM Plus to tell it apart from the original, offered back upstream in [cobanov/PS5LM#12](https://github.com/cobanov/PS5LM/pull/12). The original payload's README is kept in [docs/PAYLOAD.md](docs/PAYLOAD.md).
-
<p align="center">
- <img src="docs/media/app/dashboard-generating.jpg" width="820" alt="The PS5LM Plus dashboard on the TV while Qwen 3.8 27B generates at 20.9 tok/s">
+ <img src="ps5/app/sce_sys/icon0.png" width="128" alt="PS5LM">
</p>
-## What it does
-
-A payload gets about 6 GiB of memory and no GPU. A native app (a title) gets the console's 12 GiB of direct memory and the GPU, so PS5LM Plus runs as one: llama-server with ggml's Vulkan backend on Mihawk-99's RADV port, in one 11.44 GiB device heap.
-
-| Model (on the PS5 GPU) | Context | Generation |
-|---|---|---|
-| Qwen3.8-27B UD-Q2_K_XL (9.2 GiB) | 32k, q4_0 cache | 20.3 tok/s; a 7,775-token answer at 19.7 tok/s |
-| Qwen3.8-27B UD-IQ2_XXS (6.8 GiB) | 64k, q8_0 cache | 20.7 tok/s |
-| Gemma 4 E4B QAT q4_0 (4.8 GiB), from USB | 64k, q4_0 cache | 61 tok/s |
-| Llama 3.2 3B Instruct Q4_K_M (1.9 GiB), from USB | 64k, q8_0 cache | 124 tok/s |
-
-For comparison, the 27B on the CPU as a payload, streamed from disk, made about one token a minute.
-
-<table>
- <tr>
- <td><img src="docs/media/app/library.jpg" alt="The model library: internal storage and USB drive sections, each with its fit plan"></td>
- <td><img src="docs/media/app/dashboard-qwen.jpg" alt="The loaded-model panel for Qwen 3.8 27B UD-IQ2_XXS: its plan and llama-server arguments"></td>
- </tr>
- <tr>
- <td align="center">The model library at launch</td>
- <td align="center">Qwen 3.8 27B loaded: the plan and the arguments it runs with</td>
- </tr>
-</table>
-
-## Features
-
-- **Dashboard:** generation speed with its history, GPU and CPU use, SoC power and energy per token, temperatures and fan, the memory pool and how the model, KV cache and the rest split it, context in use, storage on every drive, and the loaded model. Cross expands the USAGE, POWER and MODEL cards.
-- **Model library:** every `.gguf` on internal storage, an M.2 drive or a USB drive, grouped by drive. Each shows the context and KV cache it would get and whether it fits; Cross loads it. A model on USB or M.2 loads straight from the drive.
-- **Settings:** load a model at launch and which one, the longest context, the KV cache type, the chat's file tools and when to warn about their folder, sounds, and which drive downloads go to. Saved to `/data/PS5LM/settings.json`.
-- **Logs:** `app.log` and `llama.log` on the TV, with an errors-only filter.
-- **Get models:** Hugging Face's GGUF repositories, most downloaded or by family. Each file shows its size and whether it fits this console (Square checks one on demand, read from the first 16 MiB of the file). Cross downloads it.
-- **Downloads:** a queue that survives a dropped connection, a pause and the app restarting. Each download resumes where it stopped, retries on its own, and shows speed and time left. Cross pauses or resumes, Square cancels. Files are checked against their SHA-256.
-
-**Safety checks**
-
-- Downloads check free space first (the file plus 1 GiB spare) and offer another drive when one has room.
-- A download while a model holds the memory asks first, and can unload it for you.
-- The chat's file tools are confined to `/data/PS5LM/scratch`, with a size warning and a Clear button.
-
-**On your network**
+<h1 align="center">PS5LM</h1>
<p align="center">
- <img src="docs/media/app/webui-chat.jpg" width="820" alt="llama.cpp's web UI served by the PS5, answering with Llama 3.2 3B">
- <br><sub>The chat in a PC's browser, served by the PS5: Llama 3.2 3B on the console's GPU at 105 tok/s</sub>
+ <b>Your PS5 runs the language model. Every device on your network uses it.</b><br>
+ llama.cpp on the console's GPU, with OpenAI and Anthropic APIs and a screen made for the TV.
</p>
-- **Chat:** llama.cpp's web UI at `http://<console IP>:8081`, with file tools and, for vision models such as Gemma 4, images (put the model's `mmproj` file beside it).
-- **API:** OpenAI Chat Completions and Responses, and Anthropic Messages, on the same port. opencode, codex, Claude Code and aider work against it: see [docs/CLI.md](docs/CLI.md).
-
-**Under the hood**
-
-- **Planner:** picks the longest context and the best KV cache type that fit the memory free, per model.
-- **Presets:** sampling settings for Qwen 3.5/3.6/3.8, Gemma 4, gpt-oss, Granite, Nemotron, Mistral and Llama.
-- **Sensors and storage:** a title may not read the temperature, fan or power sensors, or the real free space of a drive, so the app carries [ps5-exporter](https://github.com/Marice/ps5-exporter) and hands it to elfldr when it is not running.
-
-## What you need
-
-A jailbroken PS5, with these payloads loaded before you start the app:
-
-| Payload | Needed for | |
-|---|---|---|
-| [kstuff-lite](https://github.com/EchoStretch/kstuff-lite) | the kernel patches homebrew titles run on | required |
-| [etaHEN](https://github.com/etaHEN/etaHEN) | homebrew support (see the note below) | required |
-| [ShadowMountPlus](https://github.com/drakmor/ShadowMountPlus) | registers PS5LM Plus from `/data/homebrew` on the home screen | required |
-| [elfldr](https://github.com/ps5-payload-dev/elfldr) (port 9021) | lets the app start ps5-exporter: thermals, fan, power and real free space | strongly recommended |
-| [ftpsrv](https://github.com/ps5-payload-dev/ftpsrv) (port 2121) | installing and updating the app, copying models from a PC | recommended |
-
-ps5-exporter comes inside the app; you do not load it yourself.
-
-## Install
+<p align="center">
+ <b><a href="https://github.com/cobanov/PS5LM/releases/latest">Get the app</a></b> ·
+ <a href="https://ps5lm.cobanov.dev">Website</a> ·
+ <a href="#try-it">Get started</a> ·
+ <a href="https://github.com/cobanov/PS5LM/issues">Issues</a>
+</p>
-1. Download `ps5lm-app-vX.Y.Z.zip` from this fork's [releases](https://github.com/abhi245y/PS5LM/releases) and check it against its `.sha256`.
-2. Unzip it and copy the `PPSA99581` folder to `/data/homebrew/PPSA99581` over FTP. ShadowMountPlus adds **PS5LM Plus** to the home screen.
-3. Start PS5LM. Pick a model in **Get models**, or copy a `.gguf` to `/data/PS5LM/models`, or to `PS5LM/models` on a USB drive (exFAT) or the M.2 drive.
-4. Choose the model in the library. Once the dashboard says Ready, open `http://<console IP>:8081` on a phone or computer.
+> **New: decision models, powered by [Ollaya](https://ollaya.dev).** PS5LM now runs Jev-like
+> decision models (d1, Clef, OpenJev and more) on the GPU and answers the same `/v1/systemone`
+> API as Ollaya: typed decisions with calibrated probabilities, in a fraction of a second.
-To update, close the app and copy the new `PPSA99581` folder over the old one. Settings, models and downloads stay in `/data/PS5LM`.
+PS5LM is for anyone with a jailbroken PS5 who wants a private model server at home. It loads a GGUF
+model onto the console's GPU and serves it to your laptop, your phone and your coding tools. It needs
+no PC while it runs, no cloud and no account.
-Which models fit is in [docs/MODELS.md](docs/MODELS.md); anything llama.cpp runs works if the library shows LOAD.
+<p align="center">
+ <a href="docs/media/ps5lm-home.mp4"><img src="docs/media/ps5lm-home.gif" width="720" alt="Qwen 3.5 9B generating on a PS5, with the requests streaming across the TV"></a><br>
+ <sub>Qwen 3.5 9B answering requests from a laptop on a PS5 Slim. Click for the video.</sub>
+</p>
-## Controls
+<p align="center">
+ <img src="docs/media/app/home.jpg" width="49%" alt="Home: the model, its speed and the live requests">
+ <img src="docs/media/app/models.jpg" width="49%" alt="Models: the ones suggested for the PS5">
+ <img src="docs/media/app/home-decision.jpg" width="49%" alt="Home with a decision model">
+ <img src="docs/media/app/api.jpg" width="49%" alt="API: the endpoints and an example">
+ <br><sub>Home, Models and API on the TV.</sub>
+</p>
-| Where | Button | Does |
+## A model server under your TV
+
+- **It runs on the GPU.** llama.cpp's Vulkan backend on the console's RDNA 2 GPU, with 11.4 GB of the
+ shared memory for the model and its context. Every architecture and quantization llama.cpp knows
+ comes along.
+- **It answers your network.** OpenAI's `/v1/chat/completions`, Anthropic's `/v1/messages` (Claude Code
+ works against it) and a chat page in any browser. Point a client at `http://<console>:8081` and use
+ any model name: the loaded one answers.
+- **It decides, too.** Load a decision model and the console answers TypeSafe's `/v1/systemone`:
+ choice, score and yes-or-no questions about text and images, the API Ollaya serves on a PC.
+- **It shows its work.** Every request streams across the TV as it is answered: which device asked,
+ what it asked, and the reply as it is written.
+- **It picks what fits.** The planner reads each GGUF and gives it the longest context and best cache
+ that fit the memory free. A Suggested list holds models measured on the console, and the app
+ downloads from Hugging Face by itself, to internal storage, the M.2 drive or a USB drive.
+- **It reads images.** Models with an image projector (Gemma 4, MiniCPM-V, d1) take pictures in chat
+ and in decisions.
+
+| Model | Size | On a PS5 Slim |
|---|---|---|
-| Everywhere | L1 / R1 | previous / next page |
-| Dashboard | D-pad, Cross | move between cards, expand one; Cross on MODEL opens the library |
-| Library | Cross | load the model under the cursor (the app restarts into it) |
-| Get models | L2 / R2 | change the search (Popular, Qwen, Gemma, ...) |
-| Get models | Square | check whether the file fits |
-| Get models | Cross | open a repository; on a file, download it |
-| Downloads | Cross | pause, resume, or try a failed one again |
-| Downloads | Square | cancel (press twice; the partial file is deleted), or clear a finished one |
-| Logs | Square, Triangle | switch log, errors only |
-
-## How it was built
-
-The full notes are in [docs/CONSOLE.md](docs/CONSOLE.md). In short:
-
-- **CPU first:** Qwen 3.8 27B ran as a payload on the Zen 2 CPU, streamed from disk at about a token a minute: proof that llama.cpp works on the console, and that the GPU was needed.
-- **A title, not a payload:** llama-server linked into an fSELF `eboot.bin` with a clean-room `libc.prx`, registered through ShadowMountPlus. Titles may not `exit()`, have some libc imports resolve to nothing, and need a working `getaddrinfo`, `accept4` and `HOME`; each was found by a crash.
-- **The GPU:** ggml-vulkan on [PS5_Vulkan](https://github.com/mihawk-99/PS5_Vulkan)'s RADV with no Vulkan loader, and RADV's unified heap for 11.44 GiB in one heap.
-- **The screen:** [ps5-homebrew-ui](https://github.com/blackbearreloaded/ps5-homebrew-ui) through ps5-opengl, in the same process as RADV (the two Mesa builds share 4,399 symbol names, so the GL stack is linked with only its API visible).
-- **Switching models:** unloading in place leaves about 5 GiB of the pool held, so the app restarts itself for each switch.
-- **HTTPS:** downloads use the system's own libSceHttp2 and libSceSsl, so the app carries no TLS library or certificates.
-- **What a title cannot do:** read sensors, see real free space (`statvfs` in a title is a stub), or start processes. ps5-exporter, a payload, covers the first two.
-
-## Building the app
-
-The app links llama.cpp with ggml-vulkan against [PS5_Vulkan](https://github.com/mihawk-99/PS5_Vulkan)'s RADV build. Set up PS5_Vulkan and its forks in `.deps/src` (`PS5_Vulkan`, `PS5_Mesa` and `PS5_PayloadSDK` at the revisions PS5_Vulkan pins), then:
+| Qwen 3.5 0.8B, Q4_K_M | 0.5 GB | 207 tokens a second |
+| Qwen 3.5 9B, Q4_K_M | 5.3 GB | 55 tokens a second |
+| Qwen 3.8 27B, UD-Q2_K_XL | 9.2 GB | about 20 tokens a second, 64k context |
+| d1 Omni 600M, a decision model | 1.1 GB | 3 questions in 0.3 s; a 720p image and 7 questions in 2.9 s |
-```sh
-git clone --recursive https://github.com/abhi245y/PS5LM
-cd PS5LM
-(cd .deps/src/PS5_Vulkan && tools/setup-native-dependencies.sh && tools/build-radv.sh release && make app)
-scripts/build-app.sh # build/app-ps5/title/PPSA99581
-scripts/release-app.sh # build/release/ps5lm-app-vX.Y.Z.zip and its .sha256
-```
+## Decision models, powered by Ollaya
-From the PC, with the app on the console:
+[Ollaya](https://github.com/ollaya-dev/ollaya) runs open decision models on a PC the way Ollama runs
+language models. PS5LM brings the same idea to the console: a decision model reads a state and
+answers typed questions in one forward pass, with no text generated.
```sh
-scripts/preview-app-ui.sh # render every screen to build/app-preview/*.png (Mesa, no console)
-PS5_HOST=<console IP> scripts/ps5lm-app.sh cycle # close, deploy, launch; also close|deploy|launch
-PS5_HOST=<console IP> scripts/ps5lm-app.sh press r1 # press a button on the console
-PS5_HOST=<console IP> scripts/ps5lm-app.sh screenshot out.bmp
+curl http://<console>:8081/v1/systemone -H 'Content-Type: application/json' -d '{
+ "state": "I was charged twice this month. Refund me or I cancel.",
+ "questions": {
+ "intent": {"type": "choice", "instructions": "What does the customer want?",
+ "criteria": {"refund": null, "information": null, "cancel": null}},
+ "angry": {"type": "noul", "instructions": "Is the customer angry?"}
+ }
+}'
```
-The app closes itself on request (`/data/PS5LM/quit`), so nothing is killed while it draws. Launching uses [ps5-homebrew-dev-protocol](https://github.com/blackbearreloaded/ps5-homebrew-dev-protocol)'s launch payload, cloned into `.deps/src`. `/data/PS5LM/app-args.txt` (one argument per line) overrides the planner.
-
-| Path | What |
-|---|---|
-| `ps5/app` | the native app: dashboard, planner, store, downloads, llama-server on the GPU |
-| `third_party/llama.cpp` | upstream llama.cpp, pinned as a submodule |
-| `third_party/ps5-homebrew-ui` | the UI toolkit |
-| `patches/` | PS5 changes to llama.cpp, kept small (tool confinement, Anthropic system messages, ...) |
-| `ps5/compat`, `probes/` | the payload build's libc additions and memory probes (see [docs/PAYLOAD.md](docs/PAYLOAD.md)) |
-| `scripts/` | build, release, deploy and console tools |
-| `docs/` | [coding tools](docs/CLI.md), [models that fit](docs/MODELS.md), [console notes](docs/CONSOLE.md), [porting](docs/PORTING.md), [research](docs/RESEARCH.md), [plans](docs/plans) |
-
-## Versions and branches
-
-- Releases follow [semver](https://semver.org): tags `vX.Y.Z`, notes in [CHANGELOG.md](CHANGELOG.md), version set in `ps5/app/version.hpp` and shown on the dashboard. v0.1.x are upstream's payload releases.
-- `main` is this fork's integration branch. Each feature is built on its own branch (`feature/...`, `docs/...`) and merged into `main`.
-- `native-gpu-app` is the branch of the upstream pull request.
-
-## Why llama.cpp
+The Suggested list has d1 Omni 600M, d1 3B and Clef Flash. Any GGUF that carries llama.cpp's
+decision metadata loads the same way, and the app labels it a decision model.
-Earlier PS5 LLM work hand-writes GPU kernels for one model at a time. PS5LM ports llama.cpp itself, so every architecture and every quantization llama.cpp supports comes along: Qwen, Llama, Mistral, Gemma, from 1-bit to 8-bit.
+## Try it
-## Credits
+You need a PS5 on firmware 7.00 to 13.60, jailbroken, with these payloads loaded:
-- **[Mert Cobanov](https://github.com/cobanov)**, who created PS5LM ([cobanov/PS5LM](https://github.com/cobanov/PS5LM)): the llama.cpp port to the PS5, the payload and its library, the build scripts and the research this fork builds on.
-- [llama.cpp / ggml](https://github.com/ggml-org/llama.cpp), which does the actual work.
-- [PS5_Vulkan](https://github.com/mihawk-99/PS5_Vulkan) (Mihawk-99) for RADV on the PS5, and [ps5-homebrew-ui](https://github.com/blackbearreloaded/ps5-homebrew-ui), [ps5-opengl](https://github.com/blackbearreloaded/ps5-opengl) and ps5-homebrew-dev-protocol (BlackBearReloaded) for the app's screen and tooling.
-- [ps5-exporter](https://github.com/Marice/ps5-exporter) (Marice) for the sensors and drive space the app shows.
-- [ps5-payload-dev](https://github.com/ps5-payload-dev) (John Törnblom) for the SDK, the ELF loader, ftpsrv and klogsrv.
-- [PS5SX2](https://github.com/Swordpdf/PS5SX2), [ProsperoAI](https://github.com/blackbearreloaded/ProsperoAI) and [PS5_Vulkan](https://github.com/mihawk-99/PS5_Vulkan), whose notes on the console's memory and GPU this project leans on.
-
-## Licence
-
-GPL-3.0-or-later, see [LICENSE](LICENSE). llama.cpp keeps its MIT licence. No Sony SDK files, keys, firmware or model weights are in this repository.
+| Payload | For | |
+|---|---|---|
+| [kstuff-lite](https://github.com/EchoStretch/kstuff-lite) | the kernel patches homebrew runs on | required |
+| [etaHEN](https://github.com/etaHEN/etaHEN) | homebrew support | required |
+| [ShadowMountPlus](https://github.com/drakmor/ShadowMountPlus) | puts PS5LM on the home screen from `/data/homebrew` | required |
+| [elfldr](https://github.com/ps5-payload-dev/elfldr) (port 9021) | temperature, power and real free space, through ps5-exporter | recommended |
+| [ftpsrv](https://github.com/ps5-payload-dev/ftpsrv) (port 2121) | installing the app, copying models from a PC | recommended |
+
+1. Download `ps5lm-app-vX.Y.Z.zip` from the [latest release](https://github.com/cobanov/PS5LM/releases/latest) and unzip it.
+2. Copy the `PPSA99575` folder to `/data/homebrew` over FTP. ShadowMountPlus adds **PS5LM** to the
+ home screen.
+3. Open PS5LM, go to **Models > Suggested** and get a model. Or copy a `.gguf` to
+ `/data/PS5LM/models`, or to `PS5LM/models` on a USB drive.
+4. Load it. Once Home says Ready, open `http://<console>:8081` in a browser, or point your OpenAI or
+ Anthropic client at it.
+
+To update, copy the new folder over the old one. Settings, models and downloads stay in
+`/data/PS5LM`. Using it from coding tools (opencode, Codex, Claude Code) is in
+[docs/CLI.md](docs/CLI.md).
-PS5LM Plus is not affiliated with Sony Interactive Entertainment or Alibaba. "PlayStation" and "PS5" are trademarks of Sony Interactive Entertainment.
+| Where | Button | Does |
+|---|---|---|
+| Everywhere | L1 / R1 | Home, Models, API, Settings |
+| Home | Cross / Triangle | change the model / the API page |
+| Models | D-pad, Cross | choose a section and a model; load, unload or download it |
+| Models, Search | L2 / R2, Square | change the search; check whether a file fits |
+| Models, Downloads | Cross, Square | pause or resume; cancel (press twice) or clear |
+| Settings | D-pad, Cross | choose a category and a row; change it |
+| Settings, Diagnostics | Square, Triangle | app or server log; errors only |
+
+## Want to tinker?
+
+C++ on [ps5-homebrew-ui](https://github.com/blackbearreloaded/ps5-homebrew-ui), llama.cpp with
+ggml-vulkan on [PS5_Vulkan](https://github.com/mihawk-99/PS5_Vulkan)'s RADV, built on Linux.
+
+[Building](docs/BUILDING.md) · [Console notes](docs/CONSOLE.md) · [Porting](docs/PORTING.md) ·
+[Research](docs/RESEARCH.md) · [Models that fit](docs/MODELS.md) · [Roadmap](docs/ROADMAP.md) ·
+[Changelog](CHANGELOG.md) · [The original payload](docs/PAYLOAD.md)
+
+## Thanks
+
+- [abhi245y](https://github.com/abhi245y), who built the native GPU app this one grew from (PS5LM Plus).
+- [llama.cpp and ggml](https://github.com/ggml-org/llama.cpp), which do the actual work.
+- [Mihawk-99](https://github.com/mihawk-99) for PS5_Vulkan and RADV on the PS5, and
+ [PS5CEMU-HAR](https://github.com/premohq/PS5CEMU-HAR) for the driver patches in `patches/mesa`.
+- [BlackBearReloaded](https://github.com/blackbearreloaded) for ps5-homebrew-ui, ps5-opengl and
+ ps5-homebrew-dev-protocol, and [John Törnblom](https://github.com/ps5-payload-dev) for the SDK.
+- [Marice](https://github.com/Marice/ps5-exporter) for ps5-exporter, which the app carries.
+- [Manrope](https://github.com/sharanda/manrope) (OFL) for the type, and
+ [PocketVibe](https://github.com/cobanov/pocketvibe) for the interface sounds.
+
+---
+
+GPL-3.0-or-later, see [LICENSE](LICENSE). llama.cpp keeps its MIT licence, Manrope its OFL. No Sony
+SDK files, keys, firmware or model weights are in this repository.
+
+PS5LM is not affiliated with Sony Interactive Entertainment. "PlayStation" and "PS5" are trademarks
+of Sony Interactive Entertainment.
diff --git a/docs/BUILDING.md b/docs/BUILDING.md
new file mode 100644
index 0000000..b889f30
--- /dev/null
+++ b/docs/BUILDING.md
@@ -0,0 +1,83 @@
+# Building PS5LM
+
+The app is a PS5 title (`ps5/app`, PPSA99575): llama-server linked with ggml-vulkan against
+[PS5_Vulkan](https://github.com/mihawk-99/PS5_Vulkan)'s RADV build, a dashboard drawn with
+[ps5-homebrew-ui](https://github.com/blackbearreloaded/ps5-homebrew-ui), packed as a title folder for
+ShadowMountPlus. The build runs on x86-64 Linux; PS5_Vulkan supports Arch (CachyOS), and Fedora 44
+works too.
+
+## How it works
+
+- **A title, not a payload.** llama-server is linked into an fSELF `eboot.bin` with a clean-room
+ `libc.prx` and registered through ShadowMountPlus. Titles may not `exit()`, some libc imports
+ resolve to nothing, and `getaddrinfo`, `accept4`, `HOME` and `localeconv` need replacing
+ (`ps5/app/compat_app.c`); each was found by a crash.
+- **The GPU.** ggml-vulkan on RADV with no Vulkan loader, and RADV's unified heap for 11.44 GiB in one
+ heap. A GPU submission is costly here (its words copied, a cache flush, a state reset); measured,
+ fewer of them did not make generation faster.
+- **The screen.** ps5-homebrew-ui through ps5-opengl, in the same process as RADV. The two Mesa builds
+ share 4,399 symbol names, so the GL stack is linked with only its API visible.
+- **Switching models.** Unloading in place leaves about 5 GiB of the pool held, so the app restarts
+ itself (LoadExec) for each switch.
+- **The requests on Home.** llama-server calls three weak hooks (`patches/0007`) with each POST's body,
+ the answer as it is sent and the status; `ps5/app/activity.cpp` turns them into text.
+- **HTTPS.** Downloads use the system's libSceHttp2 and libSceSsl, so the app carries no TLS library.
+- **What a title cannot do.** Read sensors, see real free space, or start processes. ps5-exporter, a
+ payload the app sends to elfldr, covers the first two.
+
+## Build
+
+On Arch, the host packages (or run them in an `archlinux` container with the repository mounted):
+
+```sh
+pacman -S base-devel clang llvm lld cmake ninja meson glslang python-mako python-yaml python-packaging \
+ python-setuptools spirv-tools spirv-headers spirv-llvm-translator libclc vulkan-headers shaderc \
+ imagemagick ffmpeg rsync libxml2 elfutils xxd python-numpy python-fonttools python-brotli librsvg
+```
+
+PS5_Vulkan and its forks go in `.deps/src`, at the revisions PS5_Vulkan pins (its
+`tools/setup-native-dependencies.sh` and `tools/build-radv.sh` name them); RADV gets the three
+patches in [patches/mesa](../patches/mesa/README.md):
+
+```sh
+git clone --recursive https://github.com/cobanov/PS5LM && cd PS5LM
+mkdir -p .deps/src && cd .deps/src
+git clone https://github.com/mihawk-99/PS5_Vulkan
+# PS5_Mesa and PS5_PayloadSDK at the pinned commits, then:
+(cd PS5_Mesa && git am ../../../patches/mesa/*.patch)
+(cd PS5_Vulkan && bash tools/setup-native-dependencies.sh &&
+ PS5_MESA_REVISION=$(git -C ../PS5_Mesa rev-parse HEAD) bash tools/build-radv.sh release && make app)
+cd ../..
+scripts/build-app.sh # build/app-ps5/title/PPSA99575
+scripts/release-app.sh # build/release/ps5lm-app-vX.Y.Z.zip and its .sha256
+```
+
+`make app` builds PS5_Vulkan's host tool and `libc.prx`, which `build-app.sh` uses; its own demo title
+may fail to link at PS5_Vulkan's HEAD, which does not matter here.
+
+## On the PC
+
+```sh
+scripts/preview-app-ui.sh # every screen to build/app-preview/*.png (Mesa, no console)
+PS5_HOST=<console IP> scripts/ps5lm-app.sh cycle # close, deploy, launch; also close|deploy|launch
+PS5_HOST=<console IP> scripts/ps5lm-app.sh load /data/PS5LM/models/<file>.gguf
+PS5_HOST=<console IP> scripts/ps5lm-app.sh screenshot out.bmp
+```
+
+- The app closes itself on request (`/data/PS5LM/quit`), so nothing is killed while it draws.
+ Launching uses ps5-homebrew-dev-protocol's launch payload, cloned into `.deps/src`. A title started
+ any other way without a user (shsrv's `launch`) is ended by the system after about 20 seconds.
+- `/data/PS5LM/app-args.txt` (one argument a line) overrides the planner. `/data/PS5LM/env.txt` (one
+ `NAME=value` a line) sets `RADV_`, `MESA_`, `ACO_`, `GGML_` and `LLAMA_` switches before the GPU opens.
+- The artwork comes from SVG: `scripts/render-artwork.sh` renders the icon and the home screen
+ background with the site's Recursive fonts. `scripts/bake-fonts.sh` bakes Manrope for the dashboard.
+
+| Path | What |
+|---|---|
+| `ps5/app` | the app: dashboard, planner, suggestions, downloads, the request feed, llama-server on the GPU |
+| `third_party/llama.cpp` | upstream llama.cpp, pinned as a submodule |
+| `third_party/ps5-homebrew-ui` | the UI toolkit |
+| `third_party/fonts` | Manrope (OFL) |
+| `patches/` | PS5 changes to llama.cpp, kept small; `patches/mesa` the driver's |
+| `ps5/compat`, `probes/` | the payload build's libc additions and memory probes ([PAYLOAD.md](PAYLOAD.md)) |
+| `scripts/` | build, release, artwork, deploy and console tools |
diff --git a/docs/media/app/api.jpg b/docs/media/app/api.jpg
new file mode 100644
index 0000000..8abeea9
Binary files /dev/null and b/docs/media/app/api.jpg differ
diff --git a/docs/media/app/dashboard-generating.jpg b/docs/media/app/dashboard-generating.jpg
deleted file mode 100644
index b75ff05..0000000
Binary files a/docs/media/app/dashboard-generating.jpg and /dev/null differ
diff --git a/docs/media/app/dashboard-qwen.jpg b/docs/media/app/dashboard-qwen.jpg
deleted file mode 100644
index e158e84..0000000
Binary files a/docs/media/app/dashboard-qwen.jpg and /dev/null differ
diff --git a/docs/media/app/home-decision.jpg b/docs/media/app/home-decision.jpg
new file mode 100644
index 0000000..0649f7d
Binary files /dev/null and b/docs/media/app/home-decision.jpg differ
diff --git a/docs/media/app/home.jpg b/docs/media/app/home.jpg
new file mode 100644
index 0000000..fa4a63a
Binary files /dev/null and b/docs/media/app/home.jpg differ
diff --git a/docs/media/app/icon.png b/docs/media/app/icon.png
deleted file mode 100644
index 9ff369b..0000000
Binary files a/docs/media/app/icon.png and /dev/null differ
diff --git a/docs/media/app/library.jpg b/docs/media/app/library.jpg
deleted file mode 100644
index 2715857..0000000
Binary files a/docs/media/app/library.jpg and /dev/null differ
diff --git a/docs/media/app/models.jpg b/docs/media/app/models.jpg
new file mode 100644
index 0000000..2e8b5f7
Binary files /dev/null and b/docs/media/app/models.jpg differ
diff --git a/docs/media/ps5lm-home.gif b/docs/media/ps5lm-home.gif
new file mode 100644
index 0000000..836d43b
Binary files /dev/null and b/docs/media/ps5lm-home.gif differ
diff --git a/docs/media/ps5lm-home.mp4 b/docs/media/ps5lm-home.mp4
new file mode 100644
index 0000000..09d677c
Binary files /dev/null and b/docs/media/ps5lm-home.mp4 differ