frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Flux 2 Klein pure C inference

https://github.com/antirez/flux2.c
108•antirez•2h ago

Comments

reactordev•2h ago
This is both awesome and scary. Yes, now we can embed image gen in things like game engines and photoshop or build our own apps. On the other hand, we can include image gen in anything…
nusl•1h ago
This was possible before, though
rvz•1h ago
Yes, it was always possible.

It's almost as if this is the first time many have seen something built in C with zero dependencies which makes this easily possible.

Since they are used to languages with package managers adding 30 package and including 50-100+ other dependencies just before the project is able to build.

snarfy•57m ago
rip 1425

https://xkcd.com/1425/

d_watt•1h ago
Regarding the meta experiment of using LLMs to transpile to a different language, how did you feel about the outcome / process, and would you do the same process again in the future?

I've had some moments recently for my own projects as I worked through some bottle necks where I took a whole section of a project and said "rewrite in rust" to Claude and had massive speedups with a 0 shot rewrite, most recently some video recovery programs, but I then had an output product I wouldn't feel comfortable vouching for outside of my homelab setup.

antirez•1h ago
I depends on the situation. In this case the agent worked only using the reference code provided by Flux's Black Forest Labs which is basically just the pipeline implemented as a showcase. The fundamental way for this process to work is that the agent can have a feedback to understand if it is really making progresses, and to debug failures against a reference implementation. But then all the code was implemented with many implementation hints about what I wanted to obtain, and without any reference of other minimal inference libraries or kernels. So I believe this just is the effect of putting together known facts about how Transformers inference works plus an higher level idea of how software should appear to the final user. Btw today somebody took my HNSW implementation for vector sets and translated it to Swift (https://github.com/jkrukowski/swift-hnsw). I'm ok with that, nor I care of this result was obtained with AI or not. However it is nice that the target license is the same, given the implementation is so similar to the C one.
rcarmo•1h ago
This is pretty great. I’ve gone and hacked your GTE C inference project to Go purely for kicks, but this one I will look at for possible compiler optimizations and building a Mac CLI for scripting…
kubb•27m ago
This repo has Swift wrappers, not a rewrite of hnsw.c, which apparently you weren't the only author of.
antirez•21m ago
Thanks,I thought it was a complete rewrite of the same logic and algorithms.
rcarmo•1h ago
I have a set of prompts that are essentially “audit the current code changes for logic errors” (plus linting and testing, including double checking test conditions) and I run them using GPT-5.x-Codex on Claude generated code.

It’s surprising how much even Opus 4.5 still trips itself up with things like off-by-one or logic boundaries, so another model (preferably with a fresh session) can be a very effective peer reviewer.

So my checks are typically lint->test->other model->me, and relatively few things get to me in simple code. Contrived logic or maths, though, it needs to be all me.

antirez•1h ago
Something that may be interesting for the reader of this thread: this project was possible only once I started to tell Opus that it needed to take a file with all the implementation notes, and also accumulating all the things we discovered during the development process. And also, the file had clear instructions to be taken updated, and to be processed ASAP after context compaction. This kinda enabled Opus to do such a big coding task in a reasonable amount of time without loosing track. Check the file IMPLEMENTATION_NOTES.md in the GitHub repo for more info.
lukebechtel•1h ago
Very cool!

Yep, a constantly updated spec is the key. Wrote about this here:

https://lukebechtel.com/blog/vibe-speccing

I've also found it's helpful to have it keep an "experiment log" at the bottom of the original spec, or in another document, which it must update whenever things take "a surprising turn"

vessenes•1h ago
Salvatore - this is cool. I am a fan of using Steve Yegge's beads for this - it generally cuts the markdown file cruft significantly.

Did you run any benchmarking? I'm curious if python's stack is faster or slower than a pure C vibe coded inference tool.

soulofmischief•54m ago
It's funny watching people rediscover well-established paradigms. Suddenly everyone's recreating software design documents [0].

People can say what they want about LLMs reducing intelligence/ability; The trend has clearly been that people are beginning to get more organized, document things better, enforce constraints, and think in higher-level patterns. And there's renewed interest in formal verification.

LLMs will force the skilled, employable engineer to chase both maintainability and productivity from the start, in order to maintain a competitive edge with these tools. At least until robots replace us completely.

[0] https://www.atlassian.com/work-management/knowledge-sharing/...

tucnak•43m ago
This development workcycle pattern lends nicely to Antigravity, which kind of does 80% this out the box, and can be nudged to do the rest with a little bit of prompting.
thundergolfer•13m ago
Was the LLM using vision capabilities to verify the correctness of it's work? If so, how was that verification method guided by you?
antirez•11m ago
Yes, Opus could check the image to see if it matched the prompt, but I adviced the model to stop and ask the human for a better check and a description of what the cause of the corrupted image could be. But the fact it could catch obvious regressions was good.
throwaway2027•1h ago
If I asked Claude to do the same can I also just put MIT license on it with my name? https://github.com/black-forest-labs/flux2 uses Apache License apparently. I know it doesn't matter that much and as long as it's permissive and openly available people don't care it's just pedantics but still.
antirez•1h ago
The reference code shows how to setup the inference pipeline. It does not implement 99% of what the C code does. That is, the inference kernels, the transformer and so forth.
netdur•58m ago
i would love if you took the time to instruct claude to re-implement inference in c/c++, and put an mit license on it, it would be huge, but only if it actually works
badsectoracula•18m ago
FWIW stable-diffusion.cpp[0] (which implements a lot more than just stable diffusion, despite the name) is already a MIT licensed C++ library.

[0] https://github.com/leejet/stable-diffusion.cpp/

neomantra•1h ago
Thanks for sharing this — I appreciate your motivation in the README.

One suggestion, which I have been trying to do myself, is to include a PROMPTS.md file. Since your purpose is sharing and educating, it helps others see what approaches an experienced developer is using, even if you are just figuring it out.

One can use a Claude hook to maintain this deterministically. I instruct in AGENTS.md that they can read but not write it. It’s also been helpful for jumping between LLMs, to give them some background on what you’ve been doing.

antirez•59m ago
In this case, instead of a prompt I wrote a specification, but later I had to steer the models for hours. So basically the prompt is the sum of all such interactions: incredibly hard to reconstruct to something meaningful.
enriquto•55m ago
This steering is the main "source code" of the program that you wrote, isn't it? Why throw it away. It's like deleting the .c once you have obtained the .exe
minimaxir•20m ago
It's more noise than signal because it's disorganized, and hard to glean value from it (speaking from experience).
stellalo•45m ago
Doesn’t Claude Code allow to just dump entire conversations, with everything that happened in them?
joemazerino•29m ago
All sessions are located in the `~/.claude/projects/foldername` subdirectory.
ukuina•8m ago
Doesn't it lose prompts prior to the latest compaction?
neomantra•26m ago
Isn't the "steering" in the form of prompts? You note "Even if the code was generated using AI, my help in steering towards the right design, implementation choices, and correctness has been vital during the development." You are a master of this, let others see how you cook, not just taste the sauce!

I only say this as it seems one of your motivations is education. I'm also noting it for others to consider. Much appreciation either way, thanks for sharing what you did.

wyldfire•11m ago
I've only just started using it but the ralph wiggum / ralph loop plugin seems like it could be useful here.

If the spec and/or tests are sufficiently detailed maybe you can step back and let it churn until it satisfies the spec.

csto12•1h ago
As someone who doesn’t code in C and does more analytics work (SQL), is the code generated here “production grade?” One of the major criticisms I hear about llms is they tend to generate code that you wouldn’t want to maintain, is that the case here?
chrsw•45m ago
It's not bad. Skimming the code I'd say it's not enterprise quality but it's definitely better than an amateur throwaway project.
minimaxir•17m ago
Those statements are mostly out of date and symptomatic of pre-agent-optimized LLMs. Opus 4.5 with clarifying rules in the CLAUDE.md does a good job at following idiomatic best practices in my experience.

That said, I'm mixed on agentic performance for data science work but it does a good job if you clearly give it the information it needs to solve the problem (e.g. for SQL, table schema and example data)

adefa•1h ago
I ran a similar experiment last month and ported Qwen 3 Omni to llama cpp. I was able to get GGUF conversion, quantization, and all input and output modalities working in less than a week. I submitted the work as a PR to the codebase and understandably, it was rejected.

https://github.com/ggml-org/llama.cpp/pull/18404

https://huggingface.co/TrevorJS/Qwen3-Omni-30B-A3B-GGUF

antirez•1h ago
The refusal because often AI writes suboptimal GGML kernels looks very odd, to me. It means that who usually writes manually GGML kernels, could very easily steer the model into writing excellent kernels, and even a document for the agents can be compiled with the instructions on how to do a great work. If they continue in this way, soon a llama.cpp fork will emerge that will be developed much faster and potentially even better: it is unavoidable.
rjh29•34m ago
The refusal is probably because OP said "100% written by AI" and didn't indicate an interest in actually reviewing or maintaining the code. In fact, a later PR comment suggests that the AI's approach was needlessly complicated.
nickandbro•28m ago
I wonder if some of the docs from https://app.wafer.ai/docs could be used to make the model be better at writing GGML kernels. Interesting use case.

Gaussian Splatting – A$AP Rocky "Helicopter" music video

https://radiancefields.com/a-ap-rocky-releases-helicopter-music-video-featuring-gaussian-splatting
222•ChrisArchitect•3h ago•85 comments

Flux 2 Klein pure C inference

https://github.com/antirez/flux2.c
108•antirez•2h ago•38 comments

Microslop: A Web Browser Extension

https://github.com/4O4-wasd/Microslop
24•Nales•1h ago•3 comments

Breaking the Zimmermann Telegram (2018)

https://medium.com/lapsed-historian/breaking-the-zimmermann-telegram-b34ed1d73614
25•tony-allan•1h ago•0 comments

A Social Filesystem

https://overreacted.io/a-social-filesystem/
130•icy•12h ago•70 comments

Stirling Cycle Machine Analysis

https://ohioopen.library.ohio.edu/opentextbooks/9/
3•akshatjiwan•8m ago•0 comments

Sins of the Children (Adrian Tchaikovsky)

https://asteriskmag.com/issues/07/sins-of-the-children
46•maxall4•3h ago•20 comments

Show HN: Lume 0.2 – Build and Run macOS VMs with unattended setup

https://cua.ai/docs/lume/guide/getting-started/introduction
47•frabonacci•3h ago•3 comments

Command-line Tools can be 235x Faster than your Hadoop Cluster (2014)

https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html
250•tosh•11h ago•173 comments

Overlapping Markup

https://en.wikipedia.org/wiki/Overlapping_markup
37•ripe•10h ago•6 comments

Show HN: Xenia – A monospaced font built with a custom Python engine

https://github.com/Loretta1982/xenia
29•xeniafont•10h ago•8 comments

More sustainable epoxy thanks to phosphorus

https://www.empa.ch/web/s604/flamm-hemmendes-epoxidharz-nachhaltiger-machen
54•JeanKage•4d ago•19 comments

A free and open-source rootkit for Linux

https://lwn.net/SubscriberLink/1053099/19c2e8180aeb0438/
126•jwilk•11h ago•30 comments

The Cathedral, the Megachurch, and the Bazaar

https://opensourcesecurity.io/2026/01-cathedral-megachurch-bazaar/
73•todsacerdoti•4d ago•57 comments

River Runner

https://river-runner.samlearner.com/
12•coloneltcb•5d ago•6 comments

Milk-V Titan: A $329 8-Core 64-bit RISC-V mini-ITX board with PCIe Gen4x16

https://www.cnx-software.com/2026/01/12/milk-v-titan-a-329-octa-core-64-bit-risc-v-mini-itx-mothe...
128•fork-bomber•6d ago•69 comments

Starting from scratch: Training a 30M Topological Transformer

https://www.tuned.org.uk/posts/013_the_topological_transformer_training_tauformer
106•tuned•9h ago•26 comments

Predicting OpenAI's ad strategy

https://ossa-ma.github.io/blog/openads
413•calcifer•6h ago•324 comments

Show HN: Figma-use – CLI to control Figma for AI agents

https://github.com/dannote/figma-use
76•dannote•14h ago•31 comments

ThinkNext Design

https://thinknextdesign.com/home.html
207•__patchbit__•14h ago•102 comments

Evolution Unleashed (2018)

https://aeon.co/essays/science-in-flux-is-a-revolution-brewing-in-evolutionary-theory
6•DiabloD3•1h ago•0 comments

Keystone (YC S25) Is Hiring

1•pablo24602•8h ago

Show HN: HTTP:COLON – A quick HTTP header/directive inspector and reference

https://httpcolon.dev/
11•ultimoo•2h ago•3 comments

Software engineers can no longer neglect their soft skills

https://www.qu8n.com/posts/most-important-software-engineering-skill-2026
93•quanwinn•7h ago•106 comments

ASCII characters are not pixels: a deep dive into ASCII rendering

https://alexharri.com/blog/ascii-rendering
1132•alexharri•1d ago•126 comments

Echo Chess: The Quest for Solvability (2023)

https://web.archive.org/web/20230920164939/https://samiramly.com/chess
7•kurinikku•10h ago•1 comments

Iconify: Library of Open Source Icons

https://icon-sets.iconify.design/
460•sea-gold•14h ago•53 comments

Erdos 281 solved with ChatGPT 5.2 Pro

https://twitter.com/neelsomani/status/2012695714187325745
276•nl•17h ago•259 comments

What is Plan 9?

https://fqa.9front.org/fqa0.html#0.1
135•AlexeyBrin•7h ago•54 comments

Multiword matrix multiplication over large finite fields in floating-point

https://arxiv.org/abs/2601.07508
23•7777777phil•5d ago•0 comments