Authorization notice. Kyojin is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.
Who it is forAn analyst, lawyer or researcher with a very long document set who cannot send the text to a hosted service.
The problemStandard context windows force splitting long documents into chunks, which loses cross-references between sections.
The outcomeA local server that accepts one prompt of about 500K tokens and answers questions about the whole text.
What you need first
- AMD Ryzen AI Max+ 395 mini PC with 128 GB of memory (Strix Halo, gfx1151)
- ROCm build of torch, installed per doc/install.md
- Python and the hf command-line tool to download model packs
- Roughly 100 GB of free disk space for a model pack (Qwen pack is 95 GB)
Steps
- Install ROCm torch and build Kyojin per doc/install.md.
hf download yamz-labs/Qwen3.8-Flash-Next-EXL3-Yamz --local-dir ./qwen-packpython tools/qwen/serve.py --model ./qwen-pack --port 8000 -c 524288 --cache-bits 8(inferred, check the README)- Send the full document as one prompt to the OpenAI API on port 8000 and ask a specific question about it.
- Check the answer against the source text for two facts placed at different depths.
Prompt for your agent
In the Yamz-Labs/kyojin repo, start tools/qwen/serve.py with -c 524288 and --cache-bits 8 for the Qwen pack, then send <target document> as a single prompt. Expected output: an answer that cites facts from the document. Verify by checking two facts from the start and end of the text against the source before reporting.
Caveat. The README says the 500K setting needs -c 524288 at launch and the Qwen run also needs --cache-bits 8, so longer contexts require more memory and tuning.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for Yamz-Labs/kyojin and "Read a 500K-token document in one prompt"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer