Skip to content

๐Ÿ”ฎ SuperDuperDB: Bring AI to your database! Build, deploy and manage any AI application directly with your existing data infrastructure, without moving your data. Including streaming inference, scalable model training and vector search.

License

Notifications You must be signed in to change notification settings

SuperDuperDB/superduperdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Bring AI to your favorite database!

Package version Supported Python versions Coverage License - Apache 2.0

โญ SuperDuperDB is open-source: Leave a star to support the project! โญ


๐Ÿ“ฃ We have a big release v0.2 with a variety of exciting new features and integrations as well as updated docs and use-cases coming up in coming weeks. Have a glimpse here in the changelog! Also, we are launching an enterprise solution. Sign-up for the preview waiting list here.


What is SuperDuperDB? ๐Ÿ”ฎ

SuperDuperDB is a Python framework for integrating AI models, APIs, and vector search engines directly with your existing databases, including hosting of your own models, streaming inference and scalable model training/fine-tuning.

Build, deploy and manage any AI application without the need for complex pipelines, infrastructure as well as specialized vector databases, and migrating data, by integrating AI at your data's source:

  • Generative AI, LLMs, RAG, vector search
  • Standard machine learning use-cases (classification, segmentation, regression, forecasting recommendation etc.)
  • Custom AI use-cases involving specialized models
  • Even the most complex applications/workflows in which different models work together

SuperDuperDB is not a database. Think db = superduper(db): SuperDuperDB transforms your databases into an intelligent platform that allows you to leverage the full AI and Python ecosystem. A single development and deployment environment for all your AI applications in one place, fully scalable and easy to manage.

Key Features:

  • Integration of AI with your existing data infrastructure: Integrate any AI models and APIs with your databases in a single scalable deployment, without the need for additional pre-processing steps, ETL or boilerplate code.
  • Inference via change-data-capture: Have your models compute outputs automatically and immediately as new data arrives, keeping your deployment always up-to-date.
  • Scalable Model Training: Train AI models on large, diverse datasets simply by querying your training data. Ensured optimal performance via in-build computational optimizations.
  • Model Chaining: Easily setup complex workflows by connecting models and APIs to work together in an interdependent and sequential manner.
  • Simple Python Interface: Replace writing thousand of lines of glue code with simple Python commands, while being able to drill down to any layer of implementation detail, like the inner workings of your models or your training details.
  • Python-First: Bring and leverage any function, program, script or algorithm from the Python ecosystem to enhance your workflows and applications.
  • Difficult Data-Types: Work directly with images, video, audio in your database, and any type which can be encoded as bytes in Python.
  • Feature Storing: Turn your database into a centralized repository for storing and managing inputs and outputs of AI models of arbitrary data-types, making them available in a structured format and known environment.
  • Vector Search: No need to duplicate and migrate your data to additional specialized vector databases - turn your existing battle-tested database into a fully-fledged multi-modal vector-search database, including easy generation of vector embeddings and vector indexes of your data with preferred models and APIs.
Overview QuickStart

What's new in v0.2?

We've been working hard improving the quality of the project and bringing new features at the intersection of AI and databasing.

New features

  • Full support for ray as a "compute" backend (inference and training)
  • The SuperDuper "protocol" for serializing compound AI-components
  • Support for self-hosting LLMs with integrations of v-LLM, Llama.cpp and transformers fine-tuning, in particular leveraging ray features.
  • Restful server implementation

New integrations

  • ray
  • jina
  • transformers (fine-tuning)
  • llama_cpp
  • vllm

Developer contract

  • Easier path to integrating AI models. Developers only need to implement these methods
Optional Method Description
False Model.predict_one Predict on one datapoint
False Model.predict Predict on batches of datapoints
True Model.fit Fit the model on datasets
  • Easier path to integrating new databases and vector-search functionalities. Developers only need to implement:
Method Description
Query.documents Documents referred to by a query
Query.type "insert"
"delete"
"select"
"update"
Query._create_table_if_not_exists Create table in databackend if it doesn't exist
Query.primary_id Get primary-id of base table in query
Query.model_update Construct a model-update query
Query.add_fold Add a fold to a select query
Query.select_using_ids Select data using only ids
Query.select_ids Select the ids of some data
Query.select_ids_of_missing_outputs Select the ids of rows which haven't got outputs yet

Better quality

  • Fully re-vamped test-suite with separation into the following categories
Type Description Command
Unit Unittest - isolated code unit functionality make unit_testing
AI integration Test the installation together with external AI provider works make ext_testing
Databackend integration Test the installation with a fully functioning database backend make databackend_testing
Smoke Test the full integration with ray, vector-search service, data-backend, change-data capture make smoke_testing
Rest Test the Rest-ful server implementation integrates with the rest of the project make rest_testing

Better documentation

Example use-cases and apps (notebooks)

The notebooks below are examples how to make use of different frameworks, model providers, vector databases, retrieval techniques and so on.

To learn more about how to use SuperDuperDB with your database, please check our Docs and official Tutorials.

Also find use-cases and apps built by the community in the superduper-community-apps repository.

Name Link
Multimodal vector-search with a range of models and datatypes Open In Colab
RAG with self-hosted LLM Open In Colab
Fine-tune an LLM on your database Open In Colab
Featurization and fransfer learning Open In Colab

Why opt for SuperDuperDB?

Task With SuperDuperDB Without
Feature/ output computation Outputs stored directly in database. All I/O and datatype encoding (images etc.) managed automatically. Write complex MLOps / ETL pipelines to compute outputs and save outputs back to database
Vector-search One command configures vector creation, storage, and an elegant search + filtering API based on your database's API Connect a diverse array of tools for setting up, configuring and refreshing vector-search for your database.
Fine-tuning Fine-tune models directly based on data in your database. All data, weights, traces etc. can be handled and stored by superdueprdb. Training can be scaled horizontally and vertically with ray. Immense landscape of tools and integrations to manage; manage all infrastructure, hardware etc. oneself.
Data Management & Security Data stays in the database, with AI outputs stored alongside inputs available to downstream applications. Data access and security to be externally controlled via database access management. Data duplication and migration to different environments, and specialized vector databases, imposing data management overhead.
Infrastructure A single environment to build, ship, and manage your AI applications, facilitating scalability and optimal compute efficiency. Complex fragmented infrastructure, with multiple pipelines, coming with high adoption and maintenance costs and increasing security risks.
Code Minimal learning curve due to a simple and declarative API, requiring simple Python commands. Hundreds of lines of codes and settings in different environments and tools.

For more information about SuperDuperDB and why we believe it is much needed, read this blog post.

Supported Datastores (more coming soon):

Transform your existing database into a Python-only AI development and deployment stack with one command:

db = superduper('mongodb|postgres|mysql|sqlite|duckdb|snowflake://<your-db-uri>')

Supported AI Frameworks and Models (more coming soon):

Integrate, train and manage any AI model (whether from open-source, commercial models or self-developed) directly with your datastore to automatically compute outputs with a single Python command:

Pre-Integrated AI APIs (more coming soon):

Integrate externally hosted models accessible via API to work together with your other models with a simple Python command:

Infrastructure Diagram

Installation

# Option 1. SuperDuperDB Library

Ideal for building new AI applications.

pip install superduperdb

# Option 2. SuperDuperDB Container

Ideal for learning basic SuperDuperDB functionalities and testing notebooks.

docker pull superduperdb/superduperdb
docker run -p 8888:8888 superduperdb/superduperdb

# Option 3. SuperDuperDB Testenv

Ideal for learning advanced SuperDuperDB functionalities and testing whole AI stacks.

make build_sandbox
make testenv_init

Preview

Browse the re-usable snippets to understand how to accomplish difficult AI end-functionality with few lines of code using SuperDuperDB.

Community & Getting Help

If you have any problems, questions, comments, or ideas:

Contributing

There are many ways to contribute, and they are not limited to writing code. We welcome all contributions such as:

Please see our Contributing Guide for details.

Contributors

Thanks goes to these wonderful people:

License

SuperDuperDB is open-source and intended to be a community effort, and it wouldn't be possible without your support and enthusiasm. It is distributed under the terms of the Apache 2.0 license. Any contribution made to this project will be subject to the same provisions.

Join Us

We are looking for nice people who are invested in the problem we are trying to solve to join us full-time. Find roles that we are trying to fill here!