Image 1 — DIY hardware Quantum RNG
Image 2 — DIY hardware Quantum RNG
Image 3 — DIY hardware Quantum RNG
Image 4 — DIY hardware Quantum RNG
▲ 333 r/RNG

DIY hardware Quantum RNG

I wanted a "real" quantum random number generator, something where every bit is an actual physical quantum event.

First attempt was a 1970s Canon FD 55mm f1.2 with a thoriated rear element. It's pretty radioactive (the Geiger counter make scary noises). But radioactive decay gives you when an atom popped, which is timing-random, not the which-path coin flip I was after.

The build that actually worked is optical: attenuate a light source down to single photons, fire them at a 50:50 UV beam splitter, and read which way each photon went with two detectors. Through → bit 0. Bounce → bit 1.

The detectors are two Hamamatsu PMT modules a friend gave me, pulled out of a dead lab instrument. I tore it down, yanked the dichroic mirror, and dropped in a UV 50:50 splitter. For a fluorescent source I ended up using 3D-printer filament — it's faintly fluorescent at the right wavelength and doubles as a light-tight cover.

All the detection and conditioning runs on a Red Pitaya (FPGA + fast ADCs):

  • Op-amp + transistor LED current sink, reed-relay LED gate, PMT gain via dividers, all driven by the Red Pitaya's slow DACs so I could sweep everything in software instead of hand-twiddling pots.
  • VHDL threshold + edge detection on the 14-bit ADC, a coincidence veto (kills double-fires / cosmic rays), and a symmetric "global blank" after every event — that last one matters, because per-channel dead time secretly biases the stream.
  • A timestamped debug FIFO that was a chunk of fabric to build but caught a bunch of detector-memory artifacts I'd otherwise have shipped.

The hard part genuinely wasn't generating random-looking bits, but it was proving they were real random bits from the optical system and not other noise sources. Most of the project ended up being diagnostics...

I've tested it with 1.6 billion QRNG bits with the NIST test package, and it passes.

Payoff demo is a Quantum Magic 8-Ball: hit a button, it pulls fresh quantum bits and gives you one answer (and, if you're an Everettian, every other answer somewhere in the multiverse).

Full build log with schematics, scope shots, and the FPGA stuff: https://dnhkng.github.io/posts/building-the-beam-universe-splitter/

Happy to answer questions on the analog front end or the FPGA fabric — the analog side is honestly my weakest area, so I'd welcome the critique.

u/Reddactor — 11 days ago

DIY hardware quantum RNG wired into a Magic 8-Ball

I wanted a "real" quantum random number generator, something where every bit is an actual physical quantum event.

First attempt was a 1970s Canon FD 55mm f1.2 with a thoriated rear element. It's pretty radioactive (the Geiger counter make scary noises). But radioactive decay gives you when an atom popped, which is timing-random, not the which-path coin flip I was after.

The build that actually worked is optical: attenuate a light source down to single photons, fire them at a 50:50 UV beam splitter, and read which way each photon went with two detectors. Through → bit 0. Bounce → bit 1.

The detectors are two Hamamatsu PMT modules a friend gave me, pulled out of a dead lab instrument. I tore it down, yanked the dichroic mirror, and dropped in a UV 50:50 splitter. For a fluorescent source I ended up using 3D-printer filament — it's faintly fluorescent at the right wavelength and doubles as a light-tight cover.

All the detection and conditioning runs on a Red Pitaya (FPGA + fast ADCs):

  • Op-amp + transistor LED current sink, reed-relay LED gate, PMT gain via dividers, all driven by the Red Pitaya's slow DACs so I could sweep everything in software instead of hand-twiddling pots.
  • VHDL threshold + edge detection on the 14-bit ADC, a coincidence veto (kills double-fires / cosmic rays), and a symmetric "global blank" after every event — that last one matters, because per-channel dead time secretly biases the stream.
  • A timestamped debug FIFO that was a chunk of fabric to build but caught a bunch of detector-memory artifacts I'd otherwise have shipped.

The hard part genuinely wasn't generating random-looking bits, but it was proving they were real random bits from the optical system and not other noise sources. Most of the project ended up being diagnostics...

Payoff demo is a Quantum Magic 8-Ball: hit a button, it pulls fresh quantum bits and gives you one answer (and, if you're an Everettian, every other answer somewhere in the multiverse).

Full build log with schematics, scope shots, and the FPGA stuff: https://dnhkng.github.io/posts/building-the-beam-universe-splitter/ or
https://news.ycombinator.com/item?id=48689891 if you want to spread the story?

Happy to answer questions on the analog front end or the FPGA fabric — the analog side is honestly my weakest area, so I'd welcome the critique.

TL;DR, and just want to play with the Quantum Magic 8-Ball? -> https://quantumlever.stream/oracle

u/Reddactor — 11 days ago
▲ 90 r/FPGA

DIY hardware quantum RNG wired into a Magic 8-Ball

I wanted a "real" quantum random number generator, something where every bit is an actual physical quantum event.

First attempt was a 1970s Canon FD 55mm f1.2 with a thoriated rear element. It's pretty radioactive (the Geiger counter make scary noises). But radioactive decay gives you when an atom popped, which is timing-random, not the which-path coin flip I was after.

The build that actually worked is optical: attenuate a light source down to single photons, fire them at a 50:50 UV beam splitter, and read which way each photon went with two detectors. Through → bit 0. Bounce → bit 1.

The detectors are two Hamamatsu PMT modules a friend gave me, pulled out of a dead lab instrument. I tore it down, yanked the dichroic mirror, and dropped in a UV 50:50 splitter. For a fluorescent source I ended up using 3D-printer filament — it's faintly fluorescent at the right wavelength and doubles as a light-tight cover.

All the detection and conditioning runs on a Red Pitaya (FPGA + fast ADCs):

  • Op-amp + transistor LED current sink, reed-relay LED gate, PMT gain via dividers, all driven by the Red Pitaya's slow DACs so I could sweep everything in software instead of hand-twiddling pots.
  • VHDL threshold + edge detection on the 14-bit ADC, a coincidence veto (kills double-fires / cosmic rays), and a symmetric "global blank" after every event — that last one matters, because per-channel dead time secretly biases the stream.
  • A timestamped debug FIFO that was a chunk of fabric to build but caught a bunch of detector-memory artifacts I'd otherwise have shipped.
  • Performs debiasing (which deals with imbalanced detectors) with Peres Debiasing, and also noise extraction with a Toeplitz Extractor, both in Fabric.
  • Custom and slightly weird ring buffer, a First in, Last out circular buffer, for... reasons.
  • Memmaps the results to the ARM side, with a tight C++ process

The hard part genuinely wasn't generating random-looking bits, but it was proving they were real random bits from the optical system and not other noise sources. Most of the project ended up being diagnostics...

Payoff demo is a Quantum Magic 8-Ball: hit a button, it pulls fresh quantum bits and gives you one answer (and, if you're an Everettian, every other answer somewhere in the multiverse).

Full build log with schematics, scope shots, and the FPGA stuff: https://dnhkng.github.io/posts/building-the-beam-universe-splitter/
or
https://news.ycombinator.com/item?id=48689891 if you want to spread the story?

Happy to answer questions on the analog front end or the FPGA fabric — the analog side is honestly my weakest area, so I'd welcome the critique.

TL;DR, and just want to play with the Quantum Magic 8-Ball? -> https://quantumlever.stream/oracle

u/Reddactor — 11 days ago

DIY hardware quantum RNG wired into a Magic 8-Ball

I wanted a "real" quantum random number generator, something where every bit is an actual physical quantum event.

First attempt was a 1970s Canon FD 55mm f1.2 with a thoriated rear element. It's pretty radioactive (the Geiger counter make scary noises). But radioactive decay gives you when an atom popped, which is timing-random, not the which-path coin flip I was after.

The build that actually worked is optical: attenuate a light source down to single photons, fire them at a 50:50 UV beam splitter, and read which way each photon went with two detectors. Through → bit 0. Bounce → bit 1.

The detectors are two Hamamatsu PMT modules a friend gave me, pulled out of a dead lab instrument. I tore it down, yanked the dichroic mirror, and dropped in a UV 50:50 splitter. For a fluorescent source I ended up using 3D-printer filament — it's faintly fluorescent at the right wavelength and doubles as a light-tight cover.

All the detection and conditioning runs on a Red Pitaya (FPGA + fast ADCs):

  • Op-amp + transistor LED current sink, reed-relay LED gate, PMT gain via dividers, all driven by the Red Pitaya's slow DACs so I could sweep everything in software instead of hand-twiddling pots.
  • VHDL threshold + edge detection on the 14-bit ADC, a coincidence veto (kills double-fires / cosmic rays), and a symmetric "global blank" after every event — that last one matters, because per-channel dead time secretly biases the stream.
  • A timestamped debug FIFO that was a chunk of fabric to build but caught a bunch of detector-memory artifacts I'd otherwise have shipped.

The hard part genuinely wasn't generating random-looking bits, but it was proving they were real random bits from the optical system and not other noise sources. Most of the project ended up being diagnostics...

Payoff demo is a Quantum Magic 8-Ball: hit a button, it pulls fresh quantum bits and gives you one answer (and, if you're an Everettian, every other answer somewhere in the multiverse).

Full build log with schematics, scope shots, and the FPGA stuff: https://dnhkng.github.io/posts/building-the-beam-universe-splitter/

Happy to answer questions on the analog front end or the FPGA fabric — the analog side is honestly my weakest area, so I'd welcome the critique.

TL;DR, and just want to play with the Quantum Magic 8-Ball? -> https://quantumlever.stream/oracle

u/Reddactor — 11 days ago

I did some model hacks, and got GLM5.2 from about 2.5 tok/s to >50 tok/s on my GH200 system.

G'day.

This is part 3 on my Local LLM adventures. I have a crazy system hacked server-to-desktop system:

Component Spec
GPUs 2x Hopper H100, 96 GB HBM3 each
CPUs 2x Grace, 72 cores each
Host memory 480 GB LPDDR5X per Grace, 960 GB total

So I can run technically run GLM5.2. Except the naive settings were crap, like 2.5 tok/second on vLLM.

Messing with NUMA got me higher, but in the end I had to do some surgery, and I grafted the MTP head from the office zai's GLM-5.2-FP8 repo to the body of CyanKiwi's AWQ quant version.

You can do the same using these instructions. You have to pull all of CyanKiwi's weights, but only a few files from the zai repo; the script will merge the two. You also need to patch vLLM to deal with the changes.

This bumped the speed to a best case ~55 tok/sec at 4x concurrency and ~45 tok/sec for single inference, streaming from RAM to VRAM. Hope it comes in handy!

dnhkng.github.io
u/Reddactor — 12 days ago

Jetson Orin NX Build for Hermes Agent + Benchmarking

I had a huge LLM server, and now I have a tiny one! I had a Jetson Orin NX gathering dust from a long dead robotics project, from back in the Llama-7B days. I figured now with MoE and smaller models doing well, it was time to mess with it again.

Goal:

  • As silent as possible (given they bumped the power from 25W -> 40W)
  • Greater than 10 tok/s TG and 300 tok/s PP
  • at least 65K context for Hermes Agent
  • Must look cool AF 👌🏻

With those constraints, I had to take a hacksaw to the stock heatsink and make a new case. Then I tested way too many models (the expected, Gemma-4's and Qwen 3.6's), but with too many quant variations.

It's all written up in the blog!

TL;DR: Gemma 4 26B A4B UD Q2_K_XL gives:

  • 66K context window
  • 14.65 tok/s at ~8k context
  • 10.21 tok/s at ~60k context
  • Still does an OK job with multiple tool calls with long prompts

Hope this comes in handy!

u/Reddactor — 27 days ago

Here are some tips on hitting nearly 200 tok/s for DeepSeek v4 Flash on Hopper

I needed a smarter model for my local Hermes Agent setup, so I moved to DeepSeek v4 Flash.

First things first:

  • Running 4 concurrent threads on vLLM, I can hit ~400 tok/s
  • 400 x 60 x 60 x 24 x 30 is ~1B TOKENS per month!!!
  • DSv4Flash cost $0.1966 per million tokens... shit...
  • It costs me ~350 euro of electricity to generate ~200 euro of tokens. Yay!

Anyway, to loose less money, I spent some time optimising DSv4Flash. By using these quants Canada-Quant, and patching the MTP code in vLLM, I hit 193 tok/s on a Hopper system.

deets are in the blog post.

dnhkng.github.io
u/Reddactor — 28 days ago