frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: A modern C++20 AI SDK (GPT‑4o, Claude 3.5, tool‑calling)

50•cauchyk•3d ago
Hi all,

I’m hacking on new features for the ClickHouse native client and wanted the same “just call the model” ergonomics JavaScript and Python now enjoy. It didn’t exist for modern C++, so I wrote one.

ai‑sdk‑cpp (Apache‑2.0) gives you:

- Unified calls to OpenAI (GPT‑4o) and Anthropic (Claude 3.5) with a single C++20 API. - Streaming, multi‑turn chat, error handling—all std::optional/std::variant, no macros. - Tool calling (function‑calling) so the model can hit real APIs; sync or async, runs in parallel.

The tricky bit: C++ still lacks real reflection, so mapping plain functions → JSON schemas isn’t as automatic as, say, TypeScript decorators. I’d love fresh eyes on that part. Try the examples and tell me where it feels clunky. This is inspired by Vercel's AI SDK [1], and litellm [2].

Repo live here: https://github.com/ClickHouse/ai-sdk-cpp, feedback welcome!

[1] https://github.com/vercel/ai [2] https://github.com/BerriAI/litellm

Comments

rubymamis•17h ago
Very nice! I might get inspire for my own Qt C++ LLM client[1]. Do you plan to add streaming Markdown parsing? It's a challenging problem that was very fun implementing for Vox -> it allows parsing code blocks and other such advance/custom blocks (I created a custom 'tool' block) without re-rendering. My implementation is currently tied to Qt's C++ but I might make it more generic and open source it.

[1] https://www.get-vox.com/

pjmlp•16h ago
While you will need C++26 for real reflection, you could use some of the libraries that make do with what is already possible via concepts, if constexpr and type traits.

For example,

- https://www.boost.org/doc/libs/latest/doc/html/boost_pfr.htm...

- https://github.com/getml/reflect-cpp

And kudos for using modern C++.

sylware•15h ago
I was wondering, has anybody tried to use AI to port c++ to C?
bergesenha•13h ago
The json library 'glaze' has working compile time reflection for MSVC, Clang and GCC using some tricks with aggregate initializable structs. In addition to being a performant json library, it comes with the functions glz::apply and glz::to_tie which I used for general tool calling straight from deserialized json.
fsloth•12h ago
“mapping plain functions → JSON schemas”

In general I’ve found it’s much better in C++ to be verbose and plain rather than succinct and elegant.

Javascript and python lack typing so being pithy&clever in those languages has entirely different implications than in C++.

“How can I express this in the most basic, unsurprising and plainspoken C++” is usually the right question to ask. “How can I make this more elegant” is a question better suited for other languages imho.

The best C++ API when in doubt is a C style API.

N_Lens•12h ago
Agreed! C++ is a powerful language but full of footguns.

Show HN: CSS generator for a high-def glass effect

https://glass3d.dev/
204•kris-kay•9h ago•68 comments

Show HN: Issue Duration Labeler – a GitHub Action that labels issue by age

https://github.com/mireklzicar/issue-duration
2•mireklzicar•3h ago•0 comments

Show HN: Opasm, an Assembly REPL

https://github.com/aedrax/opasm
12•aedrax•12h ago•0 comments

Show HN: I made a 2D game engine in Dart

https://bullseye2d.org/
88•joemanaco•4d ago•37 comments

Show HN: Jobs by Referral: Find jobs in your LinkedIn network

https://jobsbyreferral.com/
161•nicksergeant•1d ago•62 comments

Show HN: A modern C++20 AI SDK (GPT‑4o, Claude 3.5, tool‑calling)

50•cauchyk•3d ago•6 comments

Show HN: Core – open source memory graph for LLMs – shareable, user owned

https://github.com/RedPlanetHQ/core
106•Manik_agg•1d ago•37 comments

Show HN: I built the tool I wished existed for moving Stripe between countries

https://www.stripemove.com/
97•felphos•1d ago•53 comments

Show HN: A continuation of IRS Direct File that can be self-hosted

https://github.com/openfiletax/openfile
235•elijahwright_•2d ago•30 comments

Show HN: Spegel, a Terminal Browser That Uses LLMs to Rewrite Webpages

https://simedw.com/2025/06/23/introducing-spegel/
411•simedw•1d ago•177 comments

Show HN: HackerNewt – Breadth-first exploring HN client for iOS

https://apps.apple.com/us/app/hackernewt-for-hacker-news/id6448201970
64•hnand•1d ago•30 comments

Show HN: Guide so you can clean up all your Node Versions

https://github.com/ThatGuySam/node-upgrade-checklist
3•ThatGuySam•7h ago•0 comments

Show HN: We wasted 12K on ads so we build this

https://www.kruxel.com/
2•bmahir•9h ago•0 comments

Show HN: Arch-Router – 1.5B model for LLM routing by preferences, not benchmarks

65•adilhafeez•1d ago•15 comments

Show HN: Generate 'Cooking For Engineers' style recipe cards

https://gobsmacked.io/recipes/beef-bourguignon-48e726f6-66fe-4a9e-b424-52721de36ced
5•ekglimmer•9h ago•6 comments

Show HN: Desktop Audio Proxy – Bypass CORS for Tauri/Electron Audio Streaming

https://github.com/Bandonker/desktop-audio-proxy
2•Bandonker•9h ago•0 comments

Show HN: Puteron, Systemd Competitor

https://github.com/andrewbaxter/puteron
2•rendaw•10h ago•0 comments

Show HN: Send email to fill Google Forms

https://promptrepo.com/email-to-form/
2•QueensGambit•10h ago•2 comments

Show HN: Placecard.net – Free PDF Seating Cards with Puppeteer

https://placecard.net/place-card-maker
2•cvbox•11h ago•0 comments

Show HN: Tududi – a minimal task manager you can self-host

https://tududi.com
4•cvicpp123•11h ago•1 comments

Show HN: DuckDB + React = SQLRooms Framework for Analytics Apps Without Backend

https://sqlrooms.org/
4•ilyabo•11h ago•0 comments

Show HN: Exceptional free templates, component libraries and boilerplates

https://htmlrev.com/
30•devluc•1d ago•5 comments

Show HN: TokenDagger – A tokenizer faster than OpenAI's Tiktoken

https://github.com/M4THYOU/TokenDagger
277•matthewolfe•2d ago•72 comments

Show HN: Open-Source International Space Station Tracker ESP32/Arduino for $20

https://github.com/GuitarML/SpaceStationTracker
71•keyth72•5d ago•18 comments

Show HN: The MCP Client for Outlook

https://mail.synia.tech/installation
5•alexrebe•13h ago•0 comments

Show HN: New Ensō – first public beta

https://untested.sonnet.io/notes/new-enso-first-public-beta/
247•rpastuszak•2d ago•87 comments

Show HN: Greger.el – Agentic Coding in Emacs

https://github.com/andreasjansson/greger.el
2•fagerhult•13h ago•0 comments

Show HN: I built a VPN management UI for my non-technical family

https://github.com/arashvakil/LeiaGuard
14•arashvakil•1d ago•0 comments

Show HN: ToplingDB - A Persistent Key-Value Store for External Storage

https://github.com/topling/toplingdb
72•rockeetterark•1d ago•19 comments

Show HN: I'm an airline pilot – I built interactive graphs/globes of my flights

https://jameshard.ing/pilot
1524•jamesharding•5d ago•197 comments