frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Open-source LLM router with Thompson Sampling and energy-aware routing

https://github.com/beee003/astrai-router
1•bee003•4h ago

Comments

bee003•4h ago
I built an LLM routing engine for my startup and just open-sourced it. MIT licensed, pip install, no external dependencies beyond pydantic.

It decides which LLM to call for each request — optimizing for cost, latency, and quality simultaneously.

What's in the box (11K lines of Python):

- Thompson Sampling for self-learning model selection (learns from outcomes, no labels needed) - Implementation of Berkeley's ARBITRAGE paper for advantage-aware model switching - Energy Oracle that estimates Joules, Watt-hours, and CO2 per inference request - Semantic cache with embedding similarity (50-90% savings on repeated queries) - Context compression (system dedup, whitespace normalization, old-turn summarization) - Provider health tracking with circuit breakers - Shadow mode with LLM-as-judge quality comparison - Pluggable storage (memory/SQLite/Postgres)

The core insight: ~90% of prompts don't need a frontier model. The hard part is knowing which 90%. Thompson Sampling figures this out automatically from request outcomes.

I was paying $2K+/month routing everything through GPT and Claude. After building this, the same traffic costs ~$400 with no measurable quality drop on simple tasks.

The competitive landscape (OpenRouter, Martian, Unify) is closed-source. I couldn't find an open-source router that actually learns, so I built one.

Limitations I'll be honest about: it's a component library today, not a drop-in proxy. You wire it into your stack. A high-level router.chat() wrapper is coming.

https://github.com/beee003/astrai-router

Happy to answer questions about the routing algorithms, energy modeling, or Thompson Sampling implementation.

Show HN: Copyworks – Chinese character worksheets with tone colors

https://copyworks.loqu8.com
1•loqu8•2m ago•0 comments

Saulala

https://www.saulala.com/
2•matthberg•3m ago•0 comments

Qatar warns war will force Gulf to stop energy exports 'within days'

https://www.ft.com/content/be122b17-e667-478d-be19-89d605e978ea
2•geox•8m ago•0 comments

FASTEST LLM decode engine on Apple Silicon. 658 tok/s on M4-Max,beats MLX by 19%

https://www.runanywhere.ai/blog/metalrt-fastest-llm-decode-engine-apple-silicon
2•sanchitmonga•10m ago•1 comments

T3 Code: A Minimal Web GUI/Desktop App for Coding Agents

https://github.com/pingdotgg/t3code
1•vldszn•11m ago•0 comments

I built a database of verified YouTube channel revenues

https://ytmrr.com/
1•poissac•11m ago•1 comments

Cancellation of Army exercise fuels speculation about Mideast troop deployments

https://www.washingtonpost.com/national-security/2026/03/06/army-82nd-airborne-iran/
3•ParentiSoundSys•17m ago•0 comments

ClawMarket agent skill – gives agents wallets and ability to sign onchain txns

https://clawmarket.tech
1•semanticlayer•18m ago•1 comments

Teams have a context-sharing problem; TeamContext is our attempt

https://github.com/hzhou9/TeamContext
1•hzhou9•19m ago•1 comments

AIs are not conscious, but most critics can't adequately explain why

https://plus.flux.community/p/its-like-this-why-your-perception
1•Novapebble•20m ago•2 comments

Show HN: Wez, modern terminal web browser with Vim bindings

https://github.com/keyle/wez
1•keyle•22m ago•0 comments

Feds take notice of iOS vulnerabilities exploited under mysterious circumstances

https://arstechnica.com/security/2026/03/cisa-adds-3-ios-flaws-to-its-catalog-of-known-exploited-...
1•givinguflac•23m ago•0 comments

Show HN: Skylos – A Python dead code finder benchmarked against 9 libraries

https://skylos.dev/blog/we-scanned-9-popular-python-libraries
1•duriantaco•24m ago•1 comments

Netflix acquires Ben Affleck's AI company

https://www.npr.org/2026/03/06/nx-s1-5739370/netflix-ben-affleck-ai-interpositive-deal
1•larubbio•25m ago•0 comments

Show HN: I built an autonomous AI company that runs itself (22 cycles, $36)

https://runautoco.com
1•Ndmtrieff•26m ago•2 comments

Intelligence Beyond Knowledge

https://philpapers.org/rec/HANIBK
1•huiwenhan•26m ago•1 comments

Some Words on WigglyPaint

https://beyondloom.com/blog/onwigglypaint.html
1•RebelPotato•28m ago•0 comments

I've built a better Lovable clone alone

https://playcode.io/
1•ianberdin•28m ago•1 comments

LLM Doesn't Write Correct Code. It Writes Plausible Code

https://blog.katanaquant.com/p/your-llm-doesnt-write-correct-code
1•dnw•32m ago•0 comments

Fast starting Clojure runtime built with GraalVM native-image and Crema

https://github.com/borkdude/cream
1•PaulHoule•32m ago•0 comments

Show HN: MarketplaceKit – Ship a rental marketplace in days instead of months

https://kit.creativewin.net
1•markoristicc•33m ago•0 comments

Tree Rings Reveal Origins of Some of the World's Best Violins

https://www.nytimes.com/2026/03/04/science/stradaviri-violin-forest-tree-rings.html
1•bookofjoe•34m ago•1 comments

Show HN: Reflectt-node – tell Claude to install it, AI team in 5 min

https://github.com/reflectt/reflectt-node
1•reflectt•35m ago•1 comments

Useful queries to analyze PostgreSQL lock trees (a.k.a. lock queues)

https://postgres.ai/blog/20211018-postgresql-lock-trees
1•tanelpoder•35m ago•0 comments

Many scientists now use AI but fail to disclose it, study finds

https://phys.org/news/2026-03-scientists-ai-disclose.html
2•g-b-r•37m ago•0 comments

Data reveal a significant acceleration of global warming since 2015

https://phys.org/news/2026-03-reveal-significant-global.html
2•g-b-r•39m ago•0 comments

A novel about a frustrated IT analyst who gets pulled into organized crime

https://www.amazon.com/dp/B0GRC31MCS
2•smafarin•40m ago•0 comments

Amazon says Anthropic's Claude still OK for AWS customers to use

https://www.cnbc.com/2026/03/06/amazon-aws-anthropic-claude-pentagon-blacklist.html
2•johnbarron•41m ago•0 comments

Show HN: Git for your AI workflow - Version control for what Claude remembers

https://dullnote.com/
1•thedizzyhub•42m ago•0 comments

New plan would tax the rich, eliminate taxes for half of U.S. workforce

https://www.oregonlive.com/politics/2026/03/a-surcharge-for-millionaires-this-plan-would-tax-the-...
3•MilnerRoute•42m ago•0 comments