Hacker Newsnew | past | comments | ask | show | jobs | submit | richin13's commentslogin

Not the original commenter but I’ve done this too with Pydantic AI (actually the library does it for you). See “Streaming Structured Output” here https://ai.pydantic.dev/output/#streaming-structured-output


Thanks yes! Im aware of structured outputs, llama.cpp has also great support with GBNF and several languages beyond json.

I've been trying to create go/rust ones but its way harder than just json due to all the context/state they carry over


The blog says it should be available now but I'm not seeing it. In Vertex AI it's already available.


Any plans to open source it?


Sorry, no. I'm an indie developer so I wish I can make some money with it. It would be a fair price as I wrote on landing page, will less than $20/year.

But I can share the tech stack I use:

- WXT: the browser extension framework

- Vercel AI SDK. Both SDK core and SDK UI. I wrote a bridge that I can proxy the api request to background script which compat with the SDK streaming protocol, so that I can use the SDK UI.

- Next.js: for the landing page and the up coming cloud service (e.g. prompt sync)

- Strapi: headless cms.


Fair enough. I asked because an extension like this has access to too much information which I don't like from a privacy stand point.

Thanks for sharing though!


I understand your concern. I think "access to much information" means this extension require <all_url> host_permission, which I don't want to either but it must.

Because custom AI provider's API base url is submit by user. If I want to call the API on background script, this base url must be listed on host_permissions. Otherwise it will cause a CORS problem.

optional_host_permissions may fix this problem, but since the base url is set by user, it's not possible to use this workaround.

Any suggestion?


you could give paying customers access to the code to run themselves (not open source)

if that works for you/your privacy-aware customer they can inspect the code/build it/ run their own version


Actually, the nice thing about chrome extensions is that users can view all requests made by content_script and background script through devtool. This is much more intuitive than checking the code.


>will less than $20/year.

I'd rather pay more, once, than another* subscription.

*Of which, I have reduced to two: phone plan [€5.99pcm], and mullvad [€5.00pcm].

No more.


I simply paid for Bitwarden which offers the option of storing and generating otp codes



You may try with resend (https://resend.com/)


Resend founder here - thanks for the shoutout @richin13!

a lot of people have been migrating off Sendgrid to Resend for this exact same reason.

happy to answer any questions you may have.


Hi Zeno, kudos on the launch!

what is different about resend compared to sendgrid, mailgun, mailjet, postmark etc. besides the pricing?


Our approach to email is fundamentally different. We very much believe in the power of open source, and that's why we built react.email to support the creation of beautiful templates using modern technology like React, Tailwind, and TypeScript.

These are the things that we believe: https://resend.com/philosophy


From the README:

"Ruff, like pylyzer, is a static code analysis tool for Python written in Rust, but Ruff is a linter and pylyzer is a type checker & language server. pylyzer does not perform linting, and Ruff does not perform type checking."


I read somewhere that some recent changes in systems would've made the backdoor useless so they had to rush out, which caused them to be reckless and get discovered


This refers to the fact that systemd was planning to drop the dependency on liblzma (the conpression library installed by xz), and instead dlopen it at runtime when needed. Not for security reasons, but to avoid pulling the libs into initramfs images.

The backdoor relies on sshd being patched to depend on libsystemd to call sd_notify(), which several distros had done.

OpenSSH has since merged a new patch upstream that implements similar logic to sd_notify() in sshd itself to allow distros to drop that patch.

So the attack surface of both sshd and libsystemd has since shrunk a bit.


> The backdoor relies on sshd being patched to depend on libsystemd to call sd_notify

I remember when we added sd_notify support to our services at work, I was wondering why one would pull in libsystemd as a dependency for this. I mean, there's a pure-Python library [1] that basically boils down to:

  import os, socket
  
  def notify(state=b"READY=1"):
    sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
    addr = os.getenv('NOTIFY_SOCKET')
    if addr[0] == '@':
     addr = '\0' + addr[1:]
    sock.connect(addr)
    sock.sendall(state)
With proper error handling, that's about 50 lines of C code. I would vendor that into my application in a heartbeat.

[1]: https://raw.githubusercontent.com/bb4242/sdnotify/master/sdn...


> With proper error handling, that's about 50 lines of C code.

Writing proper error handling in C is a very tedious and error prone task. So it doesn't surprise me that people would rather call another library instead.


> So it doesn't surprise me that people would rather call another library instead.

Which shall be harder to justify now: "You're calling a gigantic library full of potential security holes just to call one function, to save writing a few lines of code, are you trying to JIA TAN the project?".


> Writing proper error handling in C is a very tedious and error prone task.

Managing C dependencies is even more tedious and error prone. And even in C, opening a UNIX domain socket to write a single packet is not that hard.


You think error handling for a socket connection + send is outside the capabilities of those developing sshd?


You think every time people call an external library to save their effort is a proof of their lack of capabilities?


> I was wondering why one would pull in libsystemd as a dependency for this. I mean, there's a pure-Python library [...] With proper error handling, that's about 50 lines of C code.

There's also a pure C library (libsystemd itself) which already does all that, and you don't need to test all the error handling cases in your 50 lines of C code. It makes sense to use the battle-tested code, instead of writing your own.


The problem is people keep focusing on the libsystemd element because systemd has it's big hate-on crew and the vector was for what's deemed "simple".

The better question though is...okay, what if the code involved was not simple? xz is a full compression algorithm, compressors have been exploit vectors for a while, so rolling your own is a terrifically bad idea in almost all cases. There's plenty of other more sophisticated libraries as well where you could've tried to pull the exact same trick - there's nothing about it being a "simple" inclusion in this case which implies vendoring or rolling your own is a good mitigation.

The saying goes that everyone is always preparing to fight the last war, not the next (particularly relevant because adversaries are likely scouring OSS looking for other projects that might be amenable to this sort of attack - how many applications have network access these days? An RCE doesn't need to be in sshd).


Frankly, I think it is idiotic to require each program to parse an environment variable, open that named file, write a magic string, and all the error handling that that requires -- all for the purpose of having a backchannel between the daemon and its supervisor?

Compare with how s6 does the same thing: instead of passing a random path via an environment variable, it opens the file descriptor itself before exec()ing the binary. All the binary has to do is write a newline to that fd and close it.

No 50 lines of C code needed.


> systems

damn it, autocorrect!


I've been using linode without any issues.


Do they still demand control over disk layouts?

I left because I couldn't use LVM, the fact they need to know disk geometry for a VM never sat well with me.

I'm under no illusion, I know the host needs to be trusted, but this is a weird/gross implementation.


I read this article a while back, it contains several alternatives

https://spencermortensen.com/articles/email-obfuscation/


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: