Library / SDK
milvus-io/pymilvus avatar
milvus-io/pymilvus

PyMilvus: the Python SDK for Milvus, and what it assumes you already have

Python SDK for Milvus Vector Database

1,408 stars463 forksPythonApache-2.0

At a glance

What is it?
PyMilvus is the official Python client for the Milvus vector database, shipped as the pymilvus package. It is a thin gRPC layer over a server you still have to run, and the version pairing between client and server is the first thing to check.
Who is it for?
Adopt PyMilvus if you already operate a Milvus 2.4, 2.5, 2.6 or 3.0 deployment and want the client version that the compatibility table pairs with it. Do not adopt it expecting a self-contained vector store: the package is a gRPC client, and the README points at a separate Milvus server repository for the engine itself.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What PyMilvus solves, and who is actually meant to use it

PyMilvus is the client half of Milvus. The repository describes it as the "Python SDK for Milvus" and links to milvus-io/milvus for the server. That split matters: installing pymilvus gives you a gRPC client, connection handling, schema and index definitions, and search calls, but no storage engine and no index build of its own. If you are looking for an embedded vector store that runs inside a Python process, this package on its own is not that.

The intended user is an application or platform engineer who already has, or plans to run, a Milvus deployment. The compatibility table in the README maps server versions to recommended client versions across ten lines, from Milvus 1.0 pairing with PyMilvus 1.0.1 through to Milvus 3.0 pairing with PyMilvus 3.0.X. That table is the most practically useful part of the README, because it tells you the project treats client and server as a matched pair rather than assuming backward compatibility across major lines.

The topics list on the repository includes milvus-lite, and the Makefile has an integration-lite target that installs a milvus-lite extra. So there is a lighter local path, but the README's own install section does not present it as the default way to get started. The default is a client pointed at a server.

How the client is structured: gRPC, protobuf, and a generated proto layer

The dependency list in pyproject.toml is the clearest statement of architecture. The runtime dependencies are grpcio, orjson, protobuf, python-dotenv, pandas, cachetools and requests. There is no vector index library, no numpy, and no embedded storage engine. Everything that computes a nearest neighbour happens on the other side of the connection.

The proto layer is generated, not hand-written. The README's development FAQ says the submodules command "will get the protos matching to the generated files", and points at milvus-io/milvus-proto for specific versions. The Makefile exposes gen_proto, which runs python_gen.sh inside pymilvus/grpc_gen, and check_proto_product, which runs gen_proto first and then a shell script. That means the wire format is pinned to a proto revision, and the repository carries a check to catch drift between the generated Python and the proto source.

This is why version mismatches are not cosmetic. The client speaks a generated gRPC surface; if the server's proto revision differs, the failure shows up at call time rather than at import time. The compatibility table is the project's answer to that, and the pyproject comment about vcs-versioning shows the maintainers care about which release line a dev build lands on.

Connection configuration is environment-driven. The .env.example file documents MILVUS_URI, MILVUS_CONN_ALIAS and MILVUS_CONN_TIMEOUT, and notes that pymilvus will read a .env file if one is provided. The commented example URI shows a remote endpoint with credentials embedded in the URL and port 19530, which is the port the sample uses.

Installing PyMilvus and running a first connection

The README gives pip as the install route for Python 3.9 and above. The base package is enough to connect and issue calls; the model and bulk_writer extras are separate installs for embedding generation and bulk import respectively.

bash
pip3 install pymilvus
pip3 install pymilvus[model]      # for milvus-model
pip3 install pymilvus[bulk_writer] # for bulk_writer

After that, the README documents pinning and upgrading. Pinning matters here more than in most packages, because the compatibility table ties client lines to server lines.

bash
pip3 install pymilvus==2.4.10
pip3 install --upgrade pymilvus

One documented shell gotcha: under zsh the bracketed extras are treated as a glob pattern. The README's own answer is to quote the requirement.

bash
pip install "pymilvus[model]"

For connection settings, copy .env.example to .env and fill in the URI. The file documents three keys, and the commented example shows the shape of a hosted endpoint.

bash
MILVUS_URI=https://username:password@in01-random123.xxx.com:19530
MILVUS_CONN_ALIAS=default
MILVUS_CONN_TIMEOUT=10

What you should see after a successful install is an importable pymilvus module and, once the .env values point at a reachable server, a working connection under the alias default. The README does not walk through a create-collection or search call in prose. For that it defers to the online API reference at milvus.io, and the repository's examples/ directory carries runnable files, including examples/example.py and examples/example_index.py, which the Makefile exposes as make example and make example_index.

Where PyMilvus is the wrong tool

The clearest boundary is that this is a client, not a database. If you want vector search with no separate process to operate, PyMilvus alone does not give you that. The repository does list milvus-lite as a topic and the Makefile has a lite integration target, but the README's install and documentation sections do not present the lite path as the primary story, and the compatibility table is written entirely in terms of server versions.

The second boundary is version skew. If your Milvus server is on a line the table does not cover, the README offers no guidance, and the proto generation workflow suggests the wire contract is not something the project treats as loosely compatible. Running a 2.4 client against a 3.0 server is not something the documentation endorses; the table pairs 3.0 with 3.0.X.

Third, the base install is not lightweight by Python standards. It pulls grpcio, protobuf, pandas, orjson, cachetools and requests. If your use case is a few thousand vectors in a script, that dependency set and a server round trip are more machinery than the problem needs. The grpcio pin is also unusually specific, listing several excluded versions and splitting the requirement by Python version, with a separate lower bound for Python 3.14 and above. That is a sign the maintainers have hit real incompatibilities in that range, and it is a constraint your resolver will inherit.

How PyMilvus differs from FAISS and from an ORM-style database client

FAISS is the natural comparison because the repository's own topics list faiss and faiss-vector-database. FAISS is a library: you load vectors into memory, build an index in-process, and search locally. There is no server, no gRPC, no proto contract, and no compatibility table, because there is nothing on the other end to be compatible with. PyMilvus inverts every one of those properties. The index lives on a Milvus node, the search is a network call, and the client version is chosen to match the server.

That difference decides the deployment shape. FAISS suits a batch job or a single-process service where the corpus fits in the machine's memory and you control the whole lifecycle. PyMilvus suits a service where the vector corpus is shared across multiple application instances, where you want the index managed independently of the application process, and where you accept operating a database in exchange for that separation. The cost is real: a network hop per search, a server to run, and a version matrix to maintain.

The second comparison is to a typical database client. PyMilvus is closer to that model than to FAISS, and the .env.example file makes the resemblance concrete: a URI, a connection alias, and a timeout, the same three knobs you would expect from a client for any networked datastore. The difference is that the schema you define through the client is not just a table definition. It includes index parameters and vector field types, which is why the examples directory carries files like examples/index_params.py and examples/customize_schema.py alongside the more ordinary examples/database.py.

Maintenance, release lines and upgrade cost

The repository is not archived, and the last push was on 2026-09-15. Recent releases listed are v3.0.1 on 2026-07-29, v2.6.17 on 2026-07-17 and v2.6.16 on 2026-06-25, so there are at least two maintained lines in parallel: the 2.6 series and the 3.0 series. That parallel structure is the main upgrade cost. If you are on 2.6, you are not being pushed to 3.0 by the release cadence, but you are also not getting 3.0 fixes.

The development workflow is documented and tooled. Local development uses uv, and the Makefile defines sync, unittest, integration-lite, benchmark, lint, format, coverage, package, get_proto, gen_proto, check_proto_product, version and install targets. The README notes that commits on a version's development branch are packaged and uploaded to Test PyPI, with a version scheme like x.y.z.rc<dist> where the suffix counts commits since the last release. Installing from there requires an explicit extra index URL, shown in the README as a pip install with --extra-index-url pointing at test.pypi.org/simple. That is a real preview channel, but it is not a stability guarantee.

On licensing: the repository is Apache-2.0, and pyproject.toml declares the Apache Software License classifier. Apache-2.0 is permissive and includes a patent grant, but this article is not legal advice, and the obligations that matter to you depend on how you distribute software that depends on pymilvus. Read the LICENSE file in the repository rather than a summary.

Editorial conclusion

Adopt PyMilvus if you already operate a Milvus 2.4, 2.5, 2.6 or 3.0 deployment and want the client version that the compatibility table pairs with it. Do not adopt it expecting a self-contained vector store: the package is a gRPC client, and the README points at a separate Milvus server repository for the engine itself. Before writing application code, verify your server version against the compatibility table, confirm Python is 3.9 or newer, and decide whether you need the model or bulk_writer extras, since both pull additional dependencies beyond the base install.

Frequently asked questions

How do I install PyMilvus?

The README gives pip3 install pymilvus for Python 3.9 and above. Extras are separate installs: pymilvus[model] for milvus-model and pymilvus[bulk_writer] for bulk_writer. Under zsh, quote the bracketed form as pip install "pymilvus[model]".

Which PyMilvus version should I use with my Milvus server?

The README's compatibility table pairs each Milvus line with a recommended PyMilvus line, for example Milvus 2.6 with PyMilvus 2.6.X and Milvus 3.0 with PyMilvus 3.0.X. Pin the client to the matching line rather than taking the newest release.

How does PyMilvus read connection settings?

The .env.example file documents MILVUS_URI, MILVUS_CONN_ALIAS and MILVUS_CONN_TIMEOUT, and notes that pymilvus will read a .env file if one is provided. The commented example URI shows credentials embedded in the URL and port 19530.

What Python versions does PyMilvus support?

The README states Python 3.9 and above for the pip install, and pyproject.toml declares classifiers from Python 3.9 through 3.14. The grpcio requirement is split by Python version, with a different lower bound for Python 3.14 and above.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. milvus-io/pymilvus on GitHub
  4. README
  5. Releases
Community notes

Community notes