I Built Binary Serializer for Pydantic Models That's Up to 7× Smaller Than JSON
Posted2 months agoActive2 months ago
github.comTechstory
supportivepositive
Debate
20/100
PydanticSerializationBinary Data
Key topics
Pydantic
Serialization
Binary Data
The author presents PyByntic, a binary serializer for Pydantic models that outperforms JSON in size, sparking interest and discussion about its potential applications and comparisons to existing solutions.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
N/A
Peak period
4
0-2h
Avg / period
2.5
Key moments
- 01Story posted
Oct 25, 2025 at 4:29 AM EDT
2 months ago
Step 01 - 02First comment
Oct 25, 2025 at 4:29 AM EDT
0s after posting
Step 02 - 03Peak activity
4 comments in 0-2h
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 26, 2025 at 5:28 AM EDT
2 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45702216Type: storyLast synced: 11/17/2025, 8:03:05 AM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
GitHub: https://github.com/sijokun/PyByntic
Works with annotated Pydantic models and gives you: – .serialize() -> bytes – .deserialize(bytes) -> Model
Curious to hear whether others here have hit similar problems and how you solved it?
P.S. Project was a Telegram MiniApp with 10m+ MAU, we were storing cached user objects in Redis Cluster
This would have been a super nice to have back then.
I wonder though how much sense it would make to get something like this mainlined into upstream Pydantic? as having this downstream would give many continuity and dependency lock concerns. And having it as part of the main library would significantly drive adoption rate.
https://github.com/pydantic/pydantic/discussions/4097
Regarding getting this into Pydantic core: I doubt the maintainers would want to ship and maintain a binary serialization layer inside the main project. That said, it might still be worth opening an issue to hear their perspective - worst case, it becomes a documented "won’t include".
As for continuity and lock-in concerns - my primary production workload depends on this library, so I fully intend to keep it updated alongside new Pydantic and Python releases. I also intentionally designed it with minimal dependencies: core functionality uses only pydantic and typing-extensions. The only extra is leb128, and that’s just for UInt128, which almost nobody truly needs - I’m considering moving that to an optional extra to keep the base install even leaner.