👋 Hi everyone, I tried to sneak this into #show-us-what-you-got
but the public response has been pretty overwhelming, so I thought I’d share it more broadly!
🤖 Yesterday we launched a new open-source product called Marvin
. (Yes, the same @Marvin
you know and love.) Marvin is a library for building AI-powered software, inspired by our own work to deploy AI here in the community, new Prefect features we’re exploring, and working with our customers that are building AI stacks. We wanted a high-level way to focus on using the AI to achieve outcomes that would also let us codify the tips and tricks we’ve been learning along the way to get good results.
:magic_wand: Marvin’s headline feature is AI Functions. These are minimalist functions that have typed inputs, outputs and a docstring, but no source code. Instead, when you call one, the output is predicted by GPT-4 (or GPT-3.5). I know this sounds 🤯 but it actually works astoundingly well. You basically write the
of a function you wish you had… and then you call it.
🎁 To get this magic, just add Marvin’s
decorator. Here’s an example:
from marvin import ai_fn
def spam_rating(email_body: str) -> int:
Returns a number between 0 and 100
that represents how likely the email is spam
spam_rating("Hey, just following up about dinner tomorrow.") # 17
spam_rating("Hi, I'm Nigerian prince and I really need your help.") # 95
⭐️ Obviously, this is cool. But more importantly, it aligns with Prefect’s product mission to eliminate negative engineering and bring engineers as close as possible to their objectives. Give Marvin a star on GitHub
and stay tuned — AI functions are just the beginning of what it can do.
💬 Marvin’s community is forming in Discord. Join us there
if building with AI is interesting to you!
🚀 Happy engineering!