Andrei Markeev (@amarkeev) header
Andrei Markeev (@amarkeev) profile picture

Principal full-stack engineer, architect, opensource author, doer. High volume systems, scalability, AI engineering.

Helsinki, Finland
Joined April 2011
Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)Photo by Andrei Markeev (@amarkeev)
Andrei Markeev retweeted
We release Needle 2: A 14MB agentic LLM for phones, wearables, smart home, robots and microcontroller. The whole model is a single 14MB binary that runs a full session in 28MB of RAM. It is built on our Simple Attention Network findings, compressed to CQ2-bit with Cactus Quants, and baked into its own engine. Needle 2 has 45m parameters trained from the ground up on 140B tool call, device use structured generation tokens. On mobile device use benchmarks, Needle 2 trades wins with frontier small LLMs like LFM2.5 230M, Apple FM Gemma-270m, at 5× to 70× smaller, and 2 bits against their f16. Needle hits 500 tokens/sec decode speed on a Raspberry Pi 5, between 400–1,500 tokens/sec on VR devices like Meta Quest 3S and Apple Vision Pro, and ranges 300–700 on sub-$200 phones such as the Samsung A-Series. Needle also runs on newer microcontrollers like ESP32. A conventional transformer of Needle's width and depth spends 164 MFLOPs per token, and even one squeezed down to Needle's parameter count spends 87, Needle spends 70. Even on a high-end phone, an always-on assistant lives inside a power budget; every MFLOP is milliwatt-hours, and Needle spends 7x to 85x fewer of them per token than the smallest performant LLMs. Read more: cactuscompute.com/needle
100
243
61
2,411
294,960
Andrei Markeev retweeted
modern containers are product of decades of research, innovation and competition what started as a simple syscall patch in the 70s has evolved into full-blown eco system with questionable resource usage in the present here's how it happened
33
159
14
3,043
317,422
Andrei Markeev retweeted
"This systematic approach toward systems correctness has become a force multiplier at AWS’s scale, enabling faster development cycles through improved developer velocity while delivering more cost-effective services to customers" cacm.acm.org/practice/system…
1
1
4
277
Andrei Markeev retweeted
Fascinating to follow @tsoding recreate the B language (predecessor to C…)!
So apparently in B programming language you don't need curly braces if your function consist of a single non-block statement. This is what we lost in C. 😔
2
2
28
2,492
This new paper by Poirier et al. is an interesting example of how baffling CPU performance can be to compiler authors. Sometimes I make a big change, and performance doesn't budge, while in other cases trivial changes have big effects. Across CPUs the effects can vary wildly.
4
19
3
108
8,865
Andrei Markeev retweeted
New @pebble blog post is up with project updates and how developers (you!) can help contribute to Pebble software. Also, here's a picture of open source PebbleOS (thank you @google!!!) running on some actual hardware!
35
52
8
615
56,488
Andrei Markeev retweeted
We’re bringing Pebble back → rePebble.com
348
727
369
4,434
742,509
Andrei Markeev retweeted
Node.js v23.6.0 is out! 🥳🎉 This release enables the flag --experimental-strip-types by default. Node.js will execute TypeScript files without additional configuration! ⚠️ This feature is experimental, has limitations and is subject to change. nodejs.org/en/blog/release/v…
17
164
30
847
90,158
Andrei Markeev retweeted
35.9 tok/sec on Windows 98 🤯 This is a 260K LLM with Llama-architecture. We also tried out larger models. Results in the blog post.
LLM running on Windows 98 PC 26 year old hardware with Intel Pentium II CPU and 128MB RAM. Uses llama98.c, our custom pure C inference engine based on @karpathy llama2.c Code and DIY guide 👇
74
295
74
2,610
569,744
Andrei Markeev retweeted
"I would argue that what good software developers do is remove problems. The opposite, in fact, of production" benrady.com/2012/11/theres-n…
2
9
301
Andrei Markeev retweeted
Please remind me how we are moving forward. In this video, a machine from the year ~2000 (600MHz, 128MB RAM, spinning-rust hard disk) running Windows NT 3.51. Note how incredibly snappy opening apps is. 👇
456
1,496
536
9,341
4,775,422
A quick post-mortem (albeit there could be more in the future) on the hydration issues I was experiencing with TanStack.com The most common hydration errors in React come from browser extensions modifying the dom before hydration occurs or from actual mismatches in server/client behavior. The latter is controllable and once you get the hang of a framework, completely avoidable. But extensions are not. Which means this is an inevitability and sure thing that you will experience hydration errors. So what do we do? When a hydration mismatch occurs, React recovers by recursively removing any fibers it's laid down going up the tree until it hits the nearest successful suspense boundary, then it falls back to a full replacement render(). If your nearest suspense boundary is <html>, React will attempt to remove the body, head and even the document! This obviously crashes everything. Another fun facet to this is using uSES to manage your state, which can produce more of these errors in quick succession. So while hydrating the entire document is technically feasible, it is a narrow path to success. If you are strictly using React APIs to manage your state and never suspend above the body, you'll be okay. React will recover and render your app, however, sometimes with a FOUC on first page load. Why would you want to hydrate the entire document anyway? So you can have 100% control over the render cycle on both server and client all the way up to the <html>. Remix is designed to collect and render all meta data and scripts via their <Meta> and <Script> tags, which need to be in the <head>. It makes a lot of sense and is honestly really nice if you can achieve it. Good job 'mix. And what if you happen to suspend above the body, or IME, use uSES to manage the router state? There's very little official guidance here outside of React's recommendation to only hydrate DOM nodes within the body, which is then immediately contradicted by their recommendation to render and stream the <html><head><body> shell from the server using renderToPipeableStream. The safest path to full document hydration in React 18 is clearly within these two seemingly contradictory recommendations, so finding a way to satisfy them both was my goal going into this To satisfy the hydration boundary limitations, I decided to hydrate into a <div id='root'> instead of the document. This was a pretty quick change. But immediately posed more issues: - <Meta> was now being rendered in the wrong place, inside of the body instead of the <head> - There was no longer a way to control <html><head><body> from the root layout. To work around these issues, I had to get creative: - I created a new server-only shell abstraction that would allow me to render <html><head><body> exactly how I wanted. Then All I had to do was render <Meta> inside of the <head>! - Since that shell was server-only though, I needed a way to also keep the meta up to date on the client... Which means I needed to render the meta on the client as well, but INTO the head somehow. .. - React portals to the rescue. On the server, the meta renders with a few comments around it to mark the ownership boundaries. Then on the client, we use a portal to render the same meta right into the head (yes you can do that). - To avoid duplicated meta, we use the comment markers around the server generated meta to remove all of it before we start portalling our client meta into the head. - Since we're not hydrating the <html><head> directly, none of this produces hydration mismatches, and since our nearest hydration boundary is now a <div> root, we don't get weird recovery errors if React needs to de-opt. While not my favorite solution, it totally works and is easily encapsulated into TanStack Router/Start's APIs. When React 19 comes out and things start migrating, I've designed these APIs to simply be deleted, and you can just move your <html><head> out of the static shell option and back into your root component. We'll still be rendering into a root div, but React will automatically hoist <html><head><body> calls AND all of our meta tags to where they belong both during streaming and after hydration. _Exhales_ Every day, I empathize more with Next.js/Remix/Redwood. The fringe/niche difficulties you encounter building a framework and the highly limited resources and prior art that exist in this area can feel hopeless as times. Why wouldn't you want to raise a bunch of money and employ as much of the React core team as possible or build an awesome product around it that justifies the cost. That's not my plan, but I get it. It's difficult.
10
18
6
232
43,230
Andrei Markeev retweeted
Node.js 22 is here 😎 Featuring: require()ing ESM graphs, WebSocket client, updates of the V8 JavaScript engine, and more. Big thank you to @_rafaelgss and @satanacchio for their work on this 🎉
26
514
88
2,221
381,407
In 2010, YouTube had 800M active users + streamed 2B+ videos daily. But internally, we were flying by the seat of our pants. One burning question was on our minds: How were people actually using YouTube? Here's the story of how one UX researcher ignited sweeping changes to how the company approached building the product: — I joined YouTube in 2009 and still recall my first planning meeting with the search team. We sat around a table and the PM asked: “So what do you all think would be cool to build?” In asking a few questions of my own, I realized the team had been building without understanding how people experienced the product. We lacked the information to make informed choices about what to prioritize across YouTube. And so we started to grow the research team. — In 2010, we convinced @kerryrodden (they/them), Google’s first Quantitative UX Researcher, to join YouTube. To get oriented, Kerry started asking PMs, Designers, Engineers, Execs, and other UX Researchers what their most pressing questions were. One question came up again and again: How were people actually using YouTube? Kerry combed through existing qualitative research, and honed in on understanding how people navigated through the site. To do this, Kerry jumped into YouTube’s user logs and was delighted to discover that YouTube’s data showed a user’s entire session — revealing a user’s navigation across all the pages they visited. (Note: User sessions were completely anonymized, so no session data was attached to an identifiable person. Also, usage data was separated from video content, so we analyzed only page types e.g., watch page or search results page, but not the actual videos or search queries.) To simplify the data, Kerry categorized all the pages of YouTube into five page types: Home, Search, Watch, Channel, and Other (account, settings, etc.). Kerry counted usage for each page type and then likelihood of the next page to visit. e.g. If someone was on the home page, what percentage of the time did they search vs watch a video? When sharing these eye-opening findings with PMs, Designers, and Engineers, Kerry was met with a barrage of additional questions: - Where were people most likely to start? - Where did they go? - What did a typical session look like? - How/when/where did sessions end? These questions led Kerry to analyze whole sessions. So they calculated where people started, and from each page, where they were most likely to go next. — Kerry had overcome the first challenge of making sense of the data. But their goal was not only to understand how people navigated YouTube, it was also to show the data in a way that everyone inside of YouTube could easily understand. After exploring several formats, Kerry landed on a radial sunburst format to visualize the data. In this view, it was easy to see the relative % of sessions that started with each page type and it was also easy to follow a user’s path across an entire session. Kerry built an interactive version that allowed us to hover and trace any path from start to end, with the percentage of sessions that followed that exact path. The image below is static, but shows the breakdown of paths people took through YouTube. (Starting from the inside and working your way to the outermost ring) — Kerry’s visualization went viral inside YouTube. It was turned into posters and hung up on the walls, printed onto t-shirts, and referenced in exec strategy decks and new hire orientation. The mystery of how people used YouTube had been unlocked. — We had all assumed YouTube’s homepage was important. The homepage had 45M+ visits per day and companies were doing home page buyout ads for huge sums of money. But Kerry’s research revealed less than half of sessions started on the homepage and people mostly came to the home page to search. The homepage showed a bunch of videos that were driven by a mass algorithm (and was pretty much the same experience whether a person was logged in or not). We were missing the opportunity to show 45M people the content they wanted to watch each day. Kerry’s visualization was an inflection point in YouTube’s history. Their findings created lasting ripple effects that elevated how well we understood users’ experiences, how we approached building products, and how so many subsequent video-first companies shaped their products. Ultimately, the team invested in building personalized recommendations, which helped transform the homepage from a search portal into a destination for finding content to watch. This transition was especially pivotal later, when everyone shifted to mobile. Personalized recommendations set YouTube up to become the dominant mobile video app, where “homepage” discovery was foundational to its success. Today, we open the YouTube app and start watching videos without even thinking — it just works. — This story has stuck with me for the past 15 years. It is a great example of what can happen when a single person is devoted to understanding the full user experience and is willing to put in the effort to cross traditionally accepted boundaries. It is so important to have a clear picture of how people experience your product — both qualitatively and quantitatively. Understanding this fuller picture can open your eyes to gaps and unexpected behaviors as well as focusing on perfecting the parts of your product where the magic happens. — A big thanks to @kerryrodden, as well as @shivar + @mags to jog my memory of different facets of this story. For more on design insights + stories, follow me at @elizlaraki.
39
215
49
1,271
259,860
Andrei Markeev retweeted
TIL of caniemail.com, which is like CanIUse but for email clients:
1
14
112
7,922
Node.js no longer needs libraries for colored output to the console. They added styleText to node:util, which does the job of chalk or picocolors. github.com/hplush/slowreader…
9
1
80
4,243