milvus-logo
LFAI
Home
  • Get Started
    • Install Milvus

Run Milvus Lite Locally

This page illustrates how to run Milvus Lite locally for development and testing purposes.

Overview

Milvus Lite is the lightweight version of Milvus, an open-source vector database that powers AI applications with vector embeddings and similarity search.

Milvus Lite can be imported into your Python application, providing the core vector search functionality of Milvus. Milvus Lite is included in the Python SDK of Milvus, thus it can be simply deployed with pip install pymilvus. This repo contains the core components of Milvus Lite.

Milvus Lite shares the same API and covers most of the features of Milvus. Together, they provide a consistent user experience across different types of environments, fitting use cases of different size. With the same client-side code, you can run a quick demo of less than a million vectors with Milvus Lite, or a small scale app with Milvus Docker container hosted on a single machine, and eventually to a large scale production deployment on Kubenetes serving billions of vectors at thousands of QPS.

Prerequisites

Milvus Lite supports the following OS distributions and sillicon types:

  • Ubuntu >= 20.04 (x86_64)
  • MacOS >= 11.0 (Apple Silicon and x86_64)

Please note that Milvus Lite is good for getting started with vector search or building demos and prototypes. For a production use case, we recommend using Milvus on Docker and Kubenetes, or considering the fully-managed Milvus on Zilliz Cloud.

Set up Milvus Lite

Milvus Lite has been packed along with pymilvus, the Python SDK library of Milvus. To set up Milvus Lite, run the following command in the terminal.

pip install "pymilvus>=2.4.2"

Connect to Milvus Lite

You can connect to Milvus Lite as follows.

from pymilvus import MilvusClient

client = MilvusClient("milvus_demo.db")

After running the above code snippet, a database file named milvus_demo.db will be generated in the current folder.

Limits

When running Milvus Lite, note that some features are not supported. The following tables summarize the usage limits on Milvus Lite.

Collection

Method / ParameterSupported in Milvus Lite
create_collection()Support with limited parameters
collection_nameY
dimensionY
primary_field_nameY
id_typeY
vector_field_nameY
metric_typeY
auto_idY
schemaY
index_paramsY
enable_dynamic_fieldY
num_shardsN
partition_key_fieldN
num_partitionsN
consistency_levelN (Only supports Strong; Any configuration will be treated as Strong.)
get_collection_stats()Supports getting collection statistics.
collection_nameY
timeoutY
describe_collection()num_shards, consistency_level, and collection_id in response are invalid.
timeoutY
has_collection()Supports checking if a collection exists.
collection_nameY
timeoutY
list_collections()Supports listing all collections.
drop_collection()Supports dropping a collection.
collection_nameY
timeoutY
rename_collection()Renaming a collection is not supported.

Field & Schema

Method / ParameterSupported in Milvus Lite
create_schema()Support with limited parameters
auto_idY
enable_dynamic_fieldY
primary_fieldY
partition_key_fieldN
add_field()Support with limited parameters
field_nameY
datatypeY
is_primaryY
max_lengthY
element_typeY
max_capacityY
dimY
is_partition_keyN
Method / ParameterSupported in Milvus Lite
search()Support with limited parameters
collection_nameY
dataY
filterY
limitY
output_fieldsY
search_paramsY
timeoutY
partition_namesN
anns_fieldY
query()Support with limited parameters
collection_nameY
filterY
output_fieldsY
timeoutY
idsY
partition_namesN
get()Support with limited parameters
collection_nameY
idsY
output_fieldsY
timeoutY
partition_namesN
delete()Support with limited parameters
collection_nameY
idsY
timeoutY
filterY
partition_nameN
insert()Support with limited parameters
collection_nameY
dataY
timeoutY
partition_nameN
upsert()Support with limited parameters
collection_nameY
dataY
timeoutY
partition_nameN

Load & Release

Method / ParameterSupported in Milvus Lite
load_collection()Y
collection_nameY
timeoutY
release_collection()Y
collection_nameY
timeoutY
get_load_state()Getting load status is not supported.
refresh_load()Loading the unloaded data of a loaded collection is not supported.
close()Y

Index

Method / ParameterSupported in Milvus Lite
list_indexes()Listing indexes is supported.
collection_nameY
field_nameY
create_index()Only supports partial index types: FLAT, HNSW, BIN_FLAT, SPARSE_INVERTED_INDEX, SPARSE_WAND.
index_paramsY
timeoutY
drop_index()Dropping indexes is supported.
collection_nameY
index_nameY
timeoutY
describe_index()Describing indexes is supported.
collection_nameY
index_nameY
timeoutY

Partition

Milvus Lite does not support partitions and partition-related methods.

Users & Roles

Milvus Lite does not support users and roles and related methods.

Alias

Milvus Lite does not support aliases and alias-related methods.

Others

For other methods not listed in the above tables, Milvus Lite does not support them.

What's next

Having connected to Milvus Lite, you can: