←back to thread

Pydantic Logfire

(pydantic.dev)
146 points ellieh | 1 comments | | HN request time: 0.222s | source
Show context
serjester ◴[] No.40212723[source]
I love pydantic but I really have to wonder why they chose this route. There's already a ton of companies that do this really well and I'm trying to figure out how their solution is any different.

The llm integration seems promising but if you care about LLM observability you probably also care about evals, guardrails and a million other things that are very specific to LLM's. Is it possible to build all this under one platform?

I do hope I'm wrong for the sake of pydantic-core.

replies(3): >>40212966 #>>40214112 #>>40214695 #
scolvin ◴[] No.40214695[source]
Pydantic creator here.

I understand why this might be your reaction, but let me just share my thoughts:

Can we build all the LLM things people want? Yes I think so, early feedback is that Logfire is already much more comprehensive than LLM specific solutions.

How is our solution any different? AFAIK:

* no one else offers opinionated wrapper for OTel to make it nicer to use, but with all the advantages

* no one else does auto-tracing (basically profiling) using import hooks the way we do

* no one else has dedicated instrumentation for OpenAI or Pydantic

* no one else provides metadata about python objects the way we do so we can render a semi-faithful repr of complex objects (Pydantic models, dataclasses, dataframes etc.) in the web UI

* no one else (except Sentry, who are doing something different) makes it really easy to start using it

* no one else lets you query observability data with SQL

In my mind, the obvious alternative would be to do the thing most OSS companies do, and build "Pydantic Cloud", then start adding features to that instead of the open source package. I didn't want to do that, and I don't think our users would like that either.

In the end I decided to build Logfire for two reasons:

1. I wanted it, and have wanted it for years

2. I think building a commercial product like this, then using OSS to spread the word and drive adoption is a really exciting way to incentivize us to make the open source as good as possible — good as-in permissive and good as-in well maintained. And it means that our commercial success is not in tension with the adoption of our open source, which has been a recurring issue for companies trying to capitalize on their open source brand.

replies(4): >>40215045 #>>40215146 #>>40215756 #>>40221179 #
hakanderyal ◴[] No.40215045[source]
Useful product, great marketing site. This is obviously a labor of love. Keep it up!

Sadly I've moved on from Python world.

Funny anecdote, using Pydantic everywhere to improve maintainability made me realize I'm fighting an uphill battle with Python and I should move to a statically typed language, so I switched to C#.

Thanks for your work.

replies(4): >>40217691 #>>40217958 #>>40218303 #>>40218360 #
necovek ◴[] No.40217958[source]
This is admittedly an unpopular opinion.

I've actually really wondered why one wants static typing, especially with a language as expressive as Python, and where you can be so efficient with it?

At a time, I was mesmerized with Zope (esp 3), but learned that nobody really learns to use it, but instead learns to work around it — for the uninitiated, Zope provided "interfaces", you'd have classes implementing those interfaces, and you could happily mix and match with "configuration" that lived in ZCML (an XML schema) files, way back in early 2000s.

Static typing really kills off some of the biggest benefits of using Python (like "duck typing" to quickly emulate an identical API without having to construct a hierarchy of types before you can do that).

How many bugs have you really hit in your Python code because of lack of static types? For ~20 years of doing Python, I honestly believe that it could have helped me at most once or twice. Generally, doing sufficient level of testing has covered most potential misuse of code, and you need to have tests anyway.

The reason I'd want to move away from Python is mostly pure performance (loops should not be this slow) and library ecosystem (crappy code has risen to the top), but I find nothing is nearly as expressive, has a comparable standard library plus allows one to be so efficient.

replies(3): >>40218609 #>>40219378 #>>40237194 #
hakanderyal ◴[] No.40219378[source]
Main selling point for me is productivity. Performance benefits are just icing on the cake.

Being explicit about types allows the IDE and platform to help you write & refactor code, allowing your brain to work on the actual problem instead.

This may sound surprising but modern C#/.NET is almost as expressive as Python. You don`t need unnecessary boilerplate or AbstractBaseFactorySingletonProxyDecoratorAdapterWrapper style types. LINQ alone is a game changer. I`m still writing code with almost same style as Python in C#, but now with the power of IDE behind me. I`m much more productive.

Interfaces are duck typing in an explicit form. Being explicit about it may sound more work, but you also need that work in Python if you want your solution to become maintainable, in the form of tests.

I`ve been using Python for ~10 years (with years of PHP/Ruby before) and written probably hundreds of thousands of lines of code. One thing I don`t like while programming is doing unnecessary work myself if the computer can do it. So I do a lot of meta programming and build abstractions when it becomes annoying to repeat myself. There had been a lot of moments where I return to a highly dynamic part of code that I`ve written months before to fix a bug and spend a lot of time trying to figure out how everything is connected. Same code in C# is both quicker to write (once you grok how reflection works and how everything is tied together), and infinitely more maintainable for less work.

Give C#/.NET a serious try. You may become surprised. I was.

replies(1): >>40275046 #
necovek ◴[] No.40275046[source]
> LINQ alone is a game changer. I`m still writing code with almost same style as Python in C#,...

That's very curious: do you have any quick examples that you could point me to?

I was generally intrigued by C# and .NET way back when it was introduced and especially when Mono started shipping the runtime for Linux, but I hated the boilerplate and couldn't move away from Python for that reason.

replies(1): >>40275971 #
1. necovek ◴[] No.40275971[source]
FWIW, I've read up on LINQ and it strikes me as having exactly the same issues as any ORM generally does: you lose on the expressiveness needed to get most optimal querying capabilities for the tool in use (eg. Postgres specifics or SQLite specifics or...).

This is not to say that one should use string concatenation to construct queries, but that you want smart tools that do just enough. I.e. I like Storm expression language or sqlalchemy-core to express SQL as Python, but getting into deeper ORM level stuff generally harms what you can achieve once you need more complex stuff.