frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Kandle – A WebGPU-based ML library written from scratch in JavaScript

https://github.com/final-kk/kandle
2•finalkk•1h ago

Comments

finalkk•1h ago
Hi HN,

I’ve spent the last 3 months building Kandle because I was frustrated with the status quo of ML on the Web.

Currently, if you want to run models in the browser, you’re mostly stuck with ONNX Runtime or WebLLM. They are incredible for production, but they are "Blackboxes." You have almost zero control over the intermediate tensors, and implementing custom logic or hooks between layers is a nightmare.

I missed the "PyTorch vibe"—the transparency and the flexibility of Eager Mode. While TensorFlow.js exists, its API has always felt "off" for those of us coming from the Torch ecosystem.

So I built Kandle from scratch. It’s a Web-native ML framework designed to bring the true PyTorch experience to JavaScript/TypeScript:

* Deeply aligned with PyTorch’s ATen/c10 architecture: I’ve implemented a complete tensor system with stride mechanisms, broadcasting, and zero-copy view operations like transpose, permute, and slice.

* Whitebox Framework: Unlike static graph engines, Kandle is Eager Mode. You can pause execution at any layer, inspect every tensor, and register forward hooks.

* Ecosystem: It includes 200+ operators, a full nn.Module system, and partial torchaudio functionality for complex pre-processing.

* Native Safetensor support: Load weights directly without painful conversions.

It’s still in the early stages (Autograd is coming next!), but the forward pass is stable enough to run models like Qwen3 and Whisper.

Interactive Demo: http://kandle-demo.vercel.app

I built a "Logit Lens" and "Attention Link" visualizer in the demo to show the unique advantage of using a whitebox framework for model interpretability in the browser. You can literally see the model's "thoughts" evolve through each layer.

Note for the Demo: Since quantization is not yet implemented, the demo currently only supports the original Qwen3-0.6B pre-trained weights in bf16 format (model.safetensors).

GitHub: https://github.com/final-kk/kandle

I’m really curious to hear what you think. Does the JS ecosystem need a "Torch standard" API, or is the current "Inference-only" path enough?

forgotpwd16•1h ago
How it compares to jax-js? Besides API preference that is.
finalkk•59m ago
Honestly, I haven't done a proper performance benchmark yet. Most of my WebGPU shaders were generated via "vibe coding" (heavily AI-assisted) to prioritize rapid architectural verification over deep kernel optimization. So, jax-js or ONNX Runtime would likely outperform Kandle in raw speed at this stage.

However, it’s hard to put aside "API preference" because that is the core feature. The real value of Kandle isn't just the syntax, but the workflow compatibility.

For example, when I implemented Qwen3 or Whisper, I could practically "copy-paste" the logic from the official HuggingFace transformers Python repository into TypeScript. You don't have to re-think the model as a static graph or adapt to a different paradigm—if it works in PyTorch, you already know how to build it in Kandle.

Beyond that, Kandle is aiming for a "batteries-included" ecosystem. We already have built-in support for Safetensors and torchaudio transforms, so you can handle the entire pipeline from loading weights to audio pre-processing (like Mel Spectrograms) without leaving the framework.

So while jax-js is great for high-performance numerical apps, Kandle is for the developer who wants to bridge the gap between Python research and Web deployment with zero cognitive overhead.

OpenAI Working on Social Media Network That Could Require Eye Scans: Report

https://gizmodo.com/openai-working-on-social-media-network-that-could-require-creepy-eye-scans-re...
1•pseudolus•1m ago•1 comments

Coffee as a staining agent substitute in electron microscopy

https://phys.org/news/2026-01-coffee-agent-substitute-electron-microscopy.html
2•PaulHoule•1m ago•0 comments

What technology takes from us – and how to take it back

https://www.theguardian.com/news/ng-interactive/2026/jan/29/what-technology-takes-from-us-and-how...
3•devonnull•2m ago•0 comments

Death of an Indian Tech Worker

https://restofworld.org/2026/india-tech-workers-crisis-suicide/
3•akbarnama•3m ago•0 comments

Call Screening Is Aggravating the Rich and Powerful

https://www.wsj.com/style/iphone-call-screening-feature-executives-511e51c4
1•JumpCrisscross•3m ago•0 comments

Connect your past, present and future, with lines on a graph

https://blog.ncase.me/lines-on-a-graph/
1•janpio•4m ago•0 comments

Alaska Airlines apologizes after passengers left stranded outside airport

https://www.sfgate.com/travel/article/travelers-stranded-island-international-airport-21312078.php
1•tima101•4m ago•0 comments

Best Gas Masks

https://www.theverge.com/policy/868571/best-gas-masks
2•cdrnsf•4m ago•0 comments

The UX of Saving and Quitting in Videogames

https://rystorm.com/blog/save-game-ux
1•gnoll_of_gozag•5m ago•0 comments

The 30th anniversary of the first C++ compiler: let's find the bugs in it

https://pvs-studio.com/en/blog/posts/cpp/0355/
1•davikr•5m ago•0 comments

Speeding up Pillow's open and save · Hugo van Kemenade

https://hugovk.dev/blog/2026/faster-pillow/
1•rbanffy•6m ago•0 comments

AI's Impact on Engineering Jobs May Be Different Than Expected

https://semiengineering.com/ais-impact-on-engineering-jobs-may-be-different-than-initial-projecti...
2•rbanffy•6m ago•0 comments

VMware Fusion 25H2 with M3 Memory Leak

https://community.broadcom.com/vmware-cloud-foundation/discussion/vmware-fusion-25h2-with-m3-memo...
1•l2dy•6m ago•0 comments

Apple buys Israeli startup Q.AI for close to $2B in race to build AI devices

https://www.ft.com/content/49f4e2e4-3a68-4842-be67-879409d06aa1
2•totaldude87•8m ago•0 comments

The Art of Engineering Management

https://taoem.com/
1•samixg•8m ago•0 comments

Things I Learned from Peter Steinberger About Building with AI

https://twitter.com/garysheng/status/2016931917145190869
2•pretext•9m ago•0 comments

Microsoft is working to rebuild trust in Windows

https://www.theverge.com/tech/870045/microsoft-windows-11-issues-rebuilding-trust-notepad
3•timpera•9m ago•4 comments

Fossil Fuels Are Doomed

https://theconversation.com/fossil-fuels-are-doomed-and-trump-cant-save-them-273798
3•evolve2k•9m ago•0 comments

Spend? or END. The aeonian debate of supply

https://bryonyoni.substack.com/p/spend-or-end
1•bryonyoni•10m ago•0 comments

The Lost Science of the Ajna Chakra [video]

https://www.youtube.com/watch?v=dFy6923KMvs
1•luskira•12m ago•0 comments

Ask HN: What are SSI/Thinking Machines working on?

1•nemath•14m ago•0 comments

Show HN: 41 Stars New AI – MIT License. Zero Hallucinations (For Real)

https://github.com/merchantmoh-debug/Remember-Me-AI
2•MohskiBroskiAI•15m ago•0 comments

AI Subs

1•aikompute-com•16m ago•0 comments

Amazon's Promotion of 'Melania' Has Critics Questioning Its Motives

https://www.nytimes.com/2026/01/28/business/media/amazon-melania-trump-film-critics.html
3•JumpCrisscross•17m ago•0 comments

Pakistan becomes latest Asian country to introduce checks for deadly Nipah virus

https://www.reuters.com/business/healthcare-pharmaceuticals/pakistan-becomes-latest-asian-country...
1•JumpCrisscross•20m ago•0 comments

GNU Gettext Reaches Version 1.0 After 30 Years in Development

https://www.phoronix.com/news/GNU-gettext-1.0
3•marcodiego•23m ago•0 comments

Drop your URL. I will Analyze and give FREE SEO tips

1•itsjoaki•23m ago•1 comments

Game jam for high schoolers in 200 cities

https://campfire.hackclub.com/
1•sadeshmukh•24m ago•0 comments

Show HN: Cueso – iPhone app for location-based grocery reminders

1•riqbal4•25m ago•1 comments

Mugabo Rongin

https://github.com/Ronny12345-art/MRcutter
1•Davidbombal•25m ago•1 comments