Register and share your invite link to earn from video plays and referrals.

Samuel Colvin
@samuelcolvin
Founder @pydantic.
926 Following    23K Followers
I’ll be at FastAPI Conf in Amsterdam! Looking forward to @samuelcolvin “Constrained Optimism” and @cailliaup “Your Agent Needs More Than an API”. If you’re around and want to talk FastAPI, agents or context engineering, let’s meet in person 👋
Show more
Remember all that shit @OpenAI and @AnthropicAI got on HN etc. for switching to httpx2 which used OS certificates, instead of bundling them... Now looks like a very prescient decision from @marcelotryle to make the change in httpx2, and the labs etc. for adopting it.
Show more
Good day to remind library developers: DO NOT SET UPPER BOUNDS ON YOUR DEPENDENCIES!
Mad plot twist - what if Monty could run JS and TS code, and even run and render React components!? Just an experiment for now, but it works amazingly well. This would be especially useful if you want agents to generate UI safely. Feedback welcome.
Show more
Monty v1.2.0 from @pydantic is released. Massive lease (as ever) with some very important features. Biggest features:
HTTPX2 2.14.0 is out! 🚀 - NO_PROXY and mounts match CIDR ranges like 192.168.0.0/16 - Bracketed IPv6 in NO_PROXY, like [::1]:8080 - Imports on FIPS-enforced Python builds - HTTP/2 and WebSocket shutdown fixes
Show more
This is why reducing your dependency on corporate entities is so important. Own your own harness. Own your own hardware. Own your privacy. Why not build on top of @pydantic AI?
Show more
Match statements merged into Monty. LFG
Pydantic AI's CodeMode can start your tools before the model finishes writing the code ⚡ - CodeMode(speculate=['get_weather']) - A call with literal keyword arguments starts once its line streams in - In my test, 3 slow lookups went from 8.7s to 4.7s
Show more
Monty runs from TypeScript too: npm install @pydantic/monty 🦀 - Run Python written by a model from your Node app - Expose your TypeScript functions to it, sync or async - Memory and time limits per session - A WebAssembly build for the browser
Show more
Guess what company I'm talking about?
HTTPX2 speaks WebSockets and Server-Sent Events out of the box 🔌 - client.websocket() and client.sse() on your existing client - Headers, cookies, auth, proxies and timeouts apply as usual - Sync and async - For WebSockets: pip install "httpx2[ws]"
Show more
It’s cool @AnthropicAI , @pydantic AI is perfect for your world ending super intelligence version of Stuxnet. Python runs everywhere too!
Fuck it, still early but here goes ... We've just released Monty v1 - a Python sandbox that starts in 1 millisecond, not 1.5 seconds. I just ran 10k sandboxed scripts in 674ms, something that would take a cloud sandbox > 3 hours. This removes the biggest drawback of letting agents write code. The future is fast. Even better, it's open source, you can install it from PyPI, npm or Crates now. Serviced platform coming soon. Please get in touch if you want to be a design partner! Who should try it? ⚡ if you care about startup time, use Monty ⚡ if you care about long-lived sessions, use Monty - Monty can be dumped and resumed at any external function call ⚡ if you care about accessing functions in the agent/host, use Monty - Monty makes it trivial to expose local functions into the sandbox ⚡ if you care about scale, use Monty - Monty workers use as little as 2MB of memory, meaning you can run thousands of concurrent sandboxes on a single machine ⚡ if you care about security, use Monty - we've run 3 rounds of bounty program and thousands of researchers have tried to break into our sandbox, meaning it should be secure to run untrusted code Who should avoid it? 🚫 if you like to take a coffee break while waiting for sandboxes to start, DO NOT use Monty 🚫 if you enjoy the challenge of routing API requests from sandboxes through your corporate network to access state in your agent without exposing secrets to the sandbox, DO NOT use Monty 🚫 if your agent really needs to install packages from PyPI, Monty won't help you yet (spoiler: it probably doesn't)
Show more
I'm mostly jealous of Macroscope's coffee machine.
I’m glad @strawgate's standards for coffee are lower than his standards for code review because many coffees were brewed by yours truly in the creation of this video. I was thrilled to sit down with Bill, who is the head of product at @pydantic, to hear about how he and the team use @Macroscope. It’s an absolute joy to work with Pydantic and to have a small part in supporting their work.
Show more
Jev vs. sonnet with @pydantic AI. cost: sonnet $0.0026 vs. jev $0.001 time: sonnet 2.36s vs. jev 643ms Shown in Pydantic Logfire. code (just 17 lines):
Show more