A batteries-included library for deploying custom AI tools.
Project description
Marvin 🤖💬
Marvin is an open-source, batteries-included library for deploying custom AI tools.
"Let’s build robots with Genuine People Personalities," they said. So they tried it out with me. I’m a personality prototype. You can tell, can’t you?
-- Marvin
Highlights
🤖 Custom bots with names, personalities, and instructions
🔋 Batteries included - get up and running instantly
🔌 Plugin system lets bots run any software
💬 Persistent threads with multiple bots
📡 Powered by GPT-4 or GPT-3.5
🌈 ChromaDB for vector search
🐍 Async Python API
🖥️ Interactive chat CLI
⚡️ FastAPI REST API
Getting started
Launching a bot is simple!
-
Install Marvin by running
pip install marvin
-
Chat by running
marvin chat
. You'll be prompted to provide an OpenAI API key if it isn't already set. You can optionally provide your bot with a name, personality, or instructions to customize the conversation:
marvin chat -p "knows every Star Wars meme" Hello there
Python API
This example shows how to configure a bot programmatically, using Marvin's async API.
from marvin import Bot
bot = Bot(personality='knows every Star Wars meme')
await bot.say('Hello there')
Rest API
Launch the Marvin REST API by running marvin server start
. You can visit http://localhost:4200
to view the API documentation.
UI
Coming soon...
Plugins
Plugins add functionality to your bot beyond simple conversation. By default, bots have access to plugins that can search the web, visit URLs, and evaluate mathematical expressions. It's easy to add new plugins or develop your own.
from marvin import Bot, Plugin
class RandomNumber(Plugin):
def run(self, a:float, b:float) -> float:
"""Generate a random number between a and b"""
return a + (b - a) * random.random()
bot = Bot(plugins=[RandomNumber()])
await bot.say('Use the plugin to pick a random number between 41 and 43')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.