Giter Club home page Giter Club logo

tinyvector's Introduction

tinyvector logo

tinyvector - a tiny embedding database in pure Rust


โœจ Features

  • Tiny: It's in the name. It's literally just an axum server. Extremely easy to customize, around 600 lines of code.
  • Fast: Tinyvector should have comparable speed to advanced vector databases when it comes on small to medium datasets, and slightly better accuracy.
  • Vertically Scales: Tinyvector stores all indexes in memory for fast querying. Very easy to scale up to 100 million+ vector dimensions without issue.
  • Open Source: MIT Licensed, free forever.

Soon

  • Powerful Queries: Allow filtering by the provided vector metadata without slowing the search down.
  • Integrated Models: Soon you won't have to bring your own vectors, just generate them on the server automaticaly. Aiming to support support SBert, Hugging Face models, OpenAI, Cohere, etc.
  • Typescript/Python Libraries: Should be able to auto-generate pretty good clients using the included OpenAPI schema.

๐Ÿš€ Getting Started

๐Ÿณ Docker

We provide a lightweight Docker container that you can run anywhere. It only takes one command to get up and running with the latest changes:

docker run \
  -p 8000:8000 \
  ghcr.io/m1guelpf/tinyvector:edge

Note When running via Docker Compose or Kubernetes, make sure to bind a volume to /tinyvector/storage for persistence. This is handled automatically in the command above.

๐Ÿ› ๏ธ Building from scratch

You can build tinyvector from the latest tagged release by running cargo install tinyvector (you might need to install Rust first). Then, run tinyvector to start up the server.

You can also build it from the latest commit by cloning the repo and running cargo build --release, and run it with ./target/release/tinyvector.

๐Ÿ’ก Why use tinyvector?

Most vector databases are overkill for simple setups. For example:

  • Using embeddings to chat with your documents. Most document search is nowhere close to what you'd need to justify accelerating search speed with HNSW or FAISS.
  • Doing search for your website or store. Unless you're selling 1,000,000 items, you don't need Pinecone.

๐Ÿงฉ Embeddings?

Embeddings are a way to compare similar things, in the same way humans compare similar things, by converting text into a small list of numbers. Similar pieces of text will have similar numbers, different ones have very different numbers.

Read OpenAI's explanation.

๐Ÿ™ Acknowledgements

  • Will Depue's tinyvector (python+sqlite+numpy) inspired me to build a vector database from scratch (and borrow the name). Will also contributed plenty of ideas to optimize performance.

๐Ÿ“„ License

This project is open-sourced under the MIT license. See the License file for more information.

tinyvector's People

Contributors

c-sinclair avatar m1guelpf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinyvector's Issues

Simple example

Hi,
Is it possible to provide a minimal embedded use example with cargo crate without server functionality?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.