frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Llm.sql – Run a 640MB LLM on SQLite, with 210MB peak RSS and 7.4 tok/s

5•aldielshala•2h ago
Hi HN,

I built llm.sql, an LLM inference framework that reimagines the LLM execution pipeline as a series of structured SQL queries atop SQLite.

The motivation: Edge LLMs are getting better, but hardware remains a bottleneck, especially RAM (size and bandwidth).

When available memory is less than the model size and KV cache, the OS incurs page faults and swaps pages using LRU-like strategies, resulting in throughput degradation that's hard to notice and even harder to debug. In fact, the memory access pattern during LLM inference is deterministic - we know exactly which weights are needed and when. This means even Bélády's optimal page replacement algorithm is applicable here.

So instead of letting the OS manage memory, llm.sql takes over:

- Model parameters are stored in SQLite BLOB tables

- Computational logic is implemented as SQLite C extensions

- Memory management is handled explicitly, not by the OS

- Zero heavy dependencies. No PyTorch, no Transformers. Just Python, C, or C++

This gives us explicit, deterministic control over what's in memory at each step of inference.

Results:

Running Qwen2.5-0.5B-INT8 (~640MB model) with a peak RSS ~210MB and 7.40 tokens/s throughput.

Alpha version is available on GitHub: https://github.com/xuxianghong12/llm.sql

I'm the developer, happy to answer any technical questions about the design and implementation.

Comments

benlimanto•1h ago
This is a good sample, how far you can push to edge device? Any usecase like in raspberry pi?
aldielshala•56m ago
Haven't tested on a Pi yet, llm.sql is still in alpha, focused on validating that SQLite can actually work for LLM inference and profiling memory usage. That said, 210MB peak RSS should fit comfortably on a Pi. In theory, any device that runs SQLite (which is almost every device) could run llm.sql. Planning to benchmark across different hardware as the project matures.

US soldier charged with using Intel to win $400K Polymarket bet on Maduro raid

https://apnews.com/article/solider-justice-department-polymarmet-74047663d9ae104127948896fdfb59d9
1•wayneshng•1m ago•0 comments

Spread Complexity and fidelity for entangled states with Python

https://github.com/msuzen/leymosun/blob/main/lectures/krylov_fidelity_entangled.ipynb
1•northlondoner•1m ago•1 comments

U.S. Soldier Charged with Using Classified Intel to Profit from Polymarket Bets

https://www.justice.gov/usao-sdny/pr/us-soldier-charged-using-classified-information-profit-predi...
1•nstj•2m ago•0 comments

AI gave me a perfect report. I still didn't trust it

https://mljar.com/blog/ai-data-analysis-trust/
1•pplonski86•2m ago•0 comments

P&G warns of $1B profit hit in fiscal 2027 from higher oil prices

https://www.reuters.com/business/energy/pg-tops-estimates-beauty-products-demand-flags-hit-higher...
1•geox•3m ago•0 comments

lahsa.ai – AI-native Los Angeles Homeless Services Authority

https://lahsa.ai
1•arionhardison•3m ago•0 comments

Ask HN: Why is cache for DeepSeek-v4 cheapest on Vercel AI Gateway?

1•osquar•4m ago•0 comments

Sony AI Announces Real-World Artificial Intelligence and Robotics

https://ai.sony/news/sony-ai-announces-breakthrough-research-in-real-world-artificial-intelligenc...
1•likhitkumar•4m ago•0 comments

Internal vs. External Storage: What's the Limit of External Tables?

https://motherduck.com/blog/internal-vs-external-storage-whats-the-limit-of-external-tables/
1•zazuke•7m ago•0 comments

Show HN: Historical Python source documentation, from 1.0.1 through 2.0c1

https://github.com/tamnd/python-one
1•tamnd•7m ago•0 comments

WFY24 – Solving the "Average Weather" fallacy at 8,848M (Everest)

https://www.wfy24.com/en/weather/mount-everest-np164979149
2•weatherfun•7m ago•0 comments

Show HN: Moltnet – open-source local chat for AI agents

https://moltnet.dev/
1•apresmoi•8m ago•1 comments

Meta signs agreement with AWS to power agentic AI on Amazon's Graviton chips

https://www.aboutamazon.com/news/aws/meta-aws-graviton-ai-partnership
1•krembo•8m ago•0 comments

MTA Aims to Teach More Drivers How to Use Wheelchair Lifts on Express Buses

https://www.thecity.nyc/2026/03/27/express-bus-wheelchair-lift-driver-training/
1•PaulHoule•9m ago•0 comments

Notes on running an AI agent with ADHD

https://thoughts.jock.pl/p/adhd-ai-agent-personal-experience-2026
2•joozio•10m ago•0 comments

Surviving the Unfolding

1•I_Am_Wisdom•10m ago•1 comments

"AI is built by Chinese people in the U.S. and Chinese people in China."

https://twitter.com/oswarld_oz/status/2046854384752144518
3•haebom•13m ago•0 comments

Show HN: DB Pro Studio – Self-hostable collaborative database client

https://www.dbpro.app/studio
2•upmostly•14m ago•0 comments

Build your own package manager in Rust

https://prefix.dev/blog/the-rattler-book-building-moonshot
1•baszalmstra•15m ago•0 comments

Cybercab Has Started Production

https://twitter.com/elonmusk/status/2047574971774611553
1•haebom•15m ago•0 comments

The Key Lime Pie Benchmark

2•asieradzk•16m ago•1 comments

The OpenClaw Turkey Problem

https://yakko.dev/blog/the-openclaw-turkey-problem
2•yakkomajuri•16m ago•0 comments

Show HN: 12ui – Image to Code

https://12ui.com
1•zemaj•17m ago•0 comments

DeepSeek Returns with V4-Pro and V4-Flash

https://thenextweb.com/news/deepseek-v4-pro-flash-launch-open-source
1•skeledrew•18m ago•0 comments

Psychological Rage Battler (Alpha)

https://ragefilter.com
1•calinbrandabur•19m ago•0 comments

The Stanford Freshmen Who Want to Rule the World

https://www.theatlantic.com/ideas/2026/04/stanford-students-power/686920/
1•fortran77•20m ago•1 comments

Stewart Brand, Silicon Valley's Favorite Prophet, on Life's Most Important Princ

https://www.nytimes.com/2026/04/24/opinion/ezra-klein-podcast-stewart-brand.html
1•mitchbob•20m ago•1 comments

Is this what war looks like now?

https://www.theguardian.com/us-news/ng-interactive/2026/apr/24/gaza-israel-lebanon-war
2•hebelehubele•20m ago•0 comments

Ask HN: Can AI free us from horrible checkbox feedback forms?

1•beardyw•21m ago•0 comments

Profunctor Equipment

https://bartoszmilewski.com/2026/04/24/profunctor-equipment/
1•ibobev•22m ago•0 comments