milvus-lite


Namemilvus-lite JSON
Version 2.4.7 PyPI version JSON
download
home_pagehttps://github.com/milvus-io/milvus-lite.git
SummaryA lightweight version of Milvus wrapped with Python.
upload_time2024-06-07 08:50:26
maintainerNone
docs_urlNone
authorMilvus Team
requires_python>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Introduction
Milvus Lite is the lightweight version of [Milvus](https://github.com/milvus-io/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](https://github.com/milvus-io/pymilvus), 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 your GenAI app with Milvus Lite on a laptop or Jupyter Notebook, or Milvus on Docker container hosted on a single machine, or a large scale production deployment on Kubenetes serving billions of vectors at thousands of QPS. 

With Milvus Lite, you can start building an AI application with vector similarity search within minutes! Milvus Lite is good for running in the following environment:
- Jupyter Notebook / Google Colab
- Laptops
- Edge Devices

# Requirements
Milvus Lite supports the following OS distributions and sillicons:
- Ubuntu >= 20.04 (x86_64)
- MacOS >= 11.0 (Apple Silicon and x86_64)

Please note that Milvus Lite is good for small scale vector search use cases. For a large scale use case, we recommend using Milvus on [Docker](https://milvus.io/docs/install_standalone-docker.md) or [Kubenetes](https://milvus.io/docs/install_cluster-milvusoperator.md), or considering the fully-managed Milvus on [Zilliz Cloud](https://zilliz.com/cloud).

# Installation
Note that milvus-lite is included in `pymilvus` since version 2.4.2, so you can install with `pymilvus` with `-U` to make sure the latest version is installed.
```shell
pip install -U pymilvus
```

# Usage
In `pymilvus`, specify a local file name as uri parameter of MilvusClient to use Milvus Lite.
```python
from pymilvus import MilvusClient
client = MilvusClient("milvus_demo.db")
```

# Examples
Following is a simple demo showing the idea of using Milvus Lite for text search. There are more comprehensive [examples](https://github.com/milvus-io/bootcamp/tree/master/bootcamp/tutorials) for using Milvus Lite to build applications
such as [RAG](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/build_RAG_with_milvus.ipynb), [image search](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/image_search_with_milvus.ipynb), and used with popular framework such as [LangChain](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_langchain.ipynb), [LlamaIndex](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_llamaindex.ipynb) and more!

```python
from pymilvus import MilvusClient
import numpy as np

client = MilvusClient("./milvus_demo.db")
client.create_collection(
    collection_name="demo_collection",
    dimension=384  # The vectors we will use in this demo has 384 dimensions
)

# Text strings to search from.
docs = [
    "Artificial intelligence was founded as an academic discipline in 1956.",
    "Alan Turing was the first person to conduct substantial research in AI.",
    "Born in Maida Vale, London, Turing was raised in southern England.",
]
# For illustration, here we use fake vectors with random numbers (384 dimension).

vectors = [[ np.random.uniform(-1, 1) for _ in range(384) ] for _ in range(len(docs)) ]
data = [ {"id": i, "vector": vectors[i], "text": docs[i], "subject": "history"} for i in range(len(vectors)) ]
res = client.insert(
    collection_name="demo_collection",
    data=data
)

# This will exclude any text in "history" subject despite close to the query vector.
res = client.search(
    collection_name="demo_collection",
    data=[vectors[0]],
    filter="subject == 'history'",
    limit=2,
    output_fields=["text", "subject"],
)
print(res)

# a query that retrieves all entities matching filter expressions.
res = client.query(
    collection_name="demo_collection",
    filter="subject == 'history'",
    output_fields=["text", "subject"],
)
print(res)

# delete
res = client.delete(
    collection_name="demo_collection",
    filter="subject == 'history'",
)
print(res)
```

# Contributing
If you want to contribute to Milvus Lite, please read the [Contributing Guide](https://github.com/milvus-io/milvus-lite/blob/main/CONTRIBUTING.md) first.

# Report a bug
For any bug or feature request, please report it by submitting an issue in [milvus-lite](https://github.com/milvus-io/milvus-lite/issues/new/choose) repo.

# License
Milvus Lite is under the Apache 2.0 license. See the [LICENSE](https://github.com/milvus-io/milvus-lite/blob/main/LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/milvus-io/milvus-lite.git",
    "name": "milvus-lite",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Milvus Team",
    "author_email": "milvus-team@zilliz.com",
    "download_url": null,
    "platform": null,
    "description": "# Introduction\nMilvus Lite is the lightweight version of [Milvus](https://github.com/milvus-io/milvus), an open-source vector database that powers AI applications with vector embeddings and similarity search.\n\nMilvus 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](https://github.com/milvus-io/pymilvus), thus it can be simply deployed with `pip install pymilvus`. This repo contains the core components of Milvus Lite.\n\nMilvus 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 your GenAI app with Milvus Lite on a laptop or Jupyter Notebook, or Milvus on Docker container hosted on a single machine, or a large scale production deployment on Kubenetes serving billions of vectors at thousands of QPS. \n\nWith Milvus Lite, you can start building an AI application with vector similarity search within minutes! Milvus Lite is good for running in the following environment:\n- Jupyter Notebook / Google Colab\n- Laptops\n- Edge Devices\n\n# Requirements\nMilvus Lite supports the following OS distributions and sillicons:\n- Ubuntu >= 20.04 (x86_64)\n- MacOS >= 11.0 (Apple Silicon and x86_64)\n\nPlease note that Milvus Lite is good for small scale vector search use cases. For a large scale use case, we recommend using Milvus on [Docker](https://milvus.io/docs/install_standalone-docker.md) or [Kubenetes](https://milvus.io/docs/install_cluster-milvusoperator.md), or considering the fully-managed Milvus on [Zilliz Cloud](https://zilliz.com/cloud).\n\n# Installation\nNote that milvus-lite is included in `pymilvus` since version 2.4.2, so you can install with `pymilvus` with `-U` to make sure the latest version is installed.\n```shell\npip install -U pymilvus\n```\n\n# Usage\nIn `pymilvus`, specify a local file name as uri parameter of MilvusClient to use Milvus Lite.\n```python\nfrom pymilvus import MilvusClient\nclient = MilvusClient(\"milvus_demo.db\")\n```\n\n# Examples\nFollowing is a simple demo showing the idea of using Milvus Lite for text search. There are more comprehensive [examples](https://github.com/milvus-io/bootcamp/tree/master/bootcamp/tutorials) for using Milvus Lite to build applications\nsuch as [RAG](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/build_RAG_with_milvus.ipynb), [image search](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/image_search_with_milvus.ipynb), and used with popular framework such as [LangChain](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_langchain.ipynb), [LlamaIndex](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_llamaindex.ipynb) and more!\n\n```python\nfrom pymilvus import MilvusClient\nimport numpy as np\n\nclient = MilvusClient(\"./milvus_demo.db\")\nclient.create_collection(\n    collection_name=\"demo_collection\",\n    dimension=384  # The vectors we will use in this demo has 384 dimensions\n)\n\n# Text strings to search from.\ndocs = [\n    \"Artificial intelligence was founded as an academic discipline in 1956.\",\n    \"Alan Turing was the first person to conduct substantial research in AI.\",\n    \"Born in Maida Vale, London, Turing was raised in southern England.\",\n]\n# For illustration, here we use fake vectors with random numbers (384 dimension).\n\nvectors = [[ np.random.uniform(-1, 1) for _ in range(384) ] for _ in range(len(docs)) ]\ndata = [ {\"id\": i, \"vector\": vectors[i], \"text\": docs[i], \"subject\": \"history\"} for i in range(len(vectors)) ]\nres = client.insert(\n    collection_name=\"demo_collection\",\n    data=data\n)\n\n# This will exclude any text in \"history\" subject despite close to the query vector.\nres = client.search(\n    collection_name=\"demo_collection\",\n    data=[vectors[0]],\n    filter=\"subject == 'history'\",\n    limit=2,\n    output_fields=[\"text\", \"subject\"],\n)\nprint(res)\n\n# a query that retrieves all entities matching filter expressions.\nres = client.query(\n    collection_name=\"demo_collection\",\n    filter=\"subject == 'history'\",\n    output_fields=[\"text\", \"subject\"],\n)\nprint(res)\n\n# delete\nres = client.delete(\n    collection_name=\"demo_collection\",\n    filter=\"subject == 'history'\",\n)\nprint(res)\n```\n\n# Contributing\nIf you want to contribute to Milvus Lite, please read the [Contributing Guide](https://github.com/milvus-io/milvus-lite/blob/main/CONTRIBUTING.md) first.\n\n# Report a bug\nFor any bug or feature request, please report it by submitting an issue in [milvus-lite](https://github.com/milvus-io/milvus-lite/issues/new/choose) repo.\n\n# License\nMilvus Lite is under the Apache 2.0 license. See the [LICENSE](https://github.com/milvus-io/milvus-lite/blob/main/LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A lightweight version of Milvus wrapped with Python.",
    "version": "2.4.7",
    "project_urls": {
        "Homepage": "https://github.com/milvus-io/milvus-lite.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1aec465abc454224998a903719a2b5cb08fc9aaac4ce01817e8b8f2f5e5a9138",
                "md5": "f0a66d226bb4fe881cb70169caed2c8d",
                "sha256": "c828190118b104b05b8c8e0b5a4147811c86b54b8fb67bc2e726ad10fc0b544e"
            },
            "downloads": -1,
            "filename": "milvus_lite-2.4.7-py3-none-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f0a66d226bb4fe881cb70169caed2c8d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 22186883,
            "upload_time": "2024-06-07T08:50:26",
            "upload_time_iso_8601": "2024-06-07T08:50:26.562639Z",
            "url": "https://files.pythonhosted.org/packages/1a/ec/465abc454224998a903719a2b5cb08fc9aaac4ce01817e8b8f2f5e5a9138/milvus_lite-2.4.7-py3-none-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "209d01d73a18451eb75f7b7a271504b166c1a2d46b23a1a3125e441ca9bc62c4",
                "md5": "f6d39181fa0989419e5e552b697cd3dc",
                "sha256": "e1537633c39879714fb15082be56a4b97f74c905a6e98e302ec01320561081af"
            },
            "downloads": -1,
            "filename": "milvus_lite-2.4.7-py3-none-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "f6d39181fa0989419e5e552b697cd3dc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 19772207,
            "upload_time": "2024-06-07T08:50:35",
            "upload_time_iso_8601": "2024-06-07T08:50:35.648044Z",
            "url": "https://files.pythonhosted.org/packages/20/9d/01d73a18451eb75f7b7a271504b166c1a2d46b23a1a3125e441ca9bc62c4/milvus_lite-2.4.7-py3-none-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36edb8694eec4dbc323efa74a4ca55210fd331202b12a29466dc6d63d442836f",
                "md5": "39ca55d161ace324734d72b3f61227ef",
                "sha256": "f016474d663045787dddf1c3aad13b7d8b61fd329220318f858184918143dcbf"
            },
            "downloads": -1,
            "filename": "milvus_lite-2.4.7-py3-none-manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "39ca55d161ace324734d72b3f61227ef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 49307692,
            "upload_time": "2024-06-07T08:50:58",
            "upload_time_iso_8601": "2024-06-07T08:50:58.874056Z",
            "url": "https://files.pythonhosted.org/packages/36/ed/b8694eec4dbc323efa74a4ca55210fd331202b12a29466dc6d63d442836f/milvus_lite-2.4.7-py3-none-manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-07 08:50:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "milvus-io",
    "github_project": "milvus-lite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "milvus-lite"
}
        
Elapsed time: 0.74817s