DEDUPED Hot AI repos, turned into use cases Get 5 a day

How to read a 500K-token document in one prompt with Kyojin

Load a very long report or codebase dump and query it locally with context up to 500K tokens.

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

  1. Install ROCm torch and build Kyojin per doc/install.md.
  2. hf download yamz-labs/Qwen3.8-Flash-Next-EXL3-Yamz --local-dir ./qwen-pack
  3. python tools/qwen/serve.py --model ./qwen-pack --port 8000 -c 524288 --cache-bits 8 (inferred, check the README)
  4. Send the full document as one prompt to the OpenAI API on port 8000 and ask a specific question about it.
  5. 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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page