milvus


Namemilvus JSON
Version 2.3.8 PyPI version JSON
download
home_pagehttps://github.com/milvus-io/milvus-lite
SummaryEmbeded Milvus
upload_time2024-02-17 14:57:51
maintainerJi Bin
docs_urlNone
authorMilvus Team
requires_python>=3.6
licenseApache-2.0
keywords milvus embeded milvus milvus server
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Milvus Lite

[![PyPI Version](https://img.shields.io/pypi/v/milvus.svg)](https://pypi.python.org/pypi/milvus)

## Introduction

Milvus Lite is a lightweight version of Milvus that can be embedded into your Python application. It is a single binary that can be easily installed and run on your machine.

It could be imported as a Python library, as well as use it as a command standalone server.

Thanks to Milvus standalone version could be run with embedded etcd and local storage, Milvus Lite does not have any other dependencies.

Everything you do with Milvus Lite, every piece of code you write for Milvus Lite can be safely migrated to other forms of Milvus (standalone version, cluster version, cloud version, etc.).

Please note that it is not suggested to use Milvus Lite in a production environment. Consider using Milvus clustered or the fully managed Milvus on Cloud. 


## Requirements

Milvus Lite is available in:
- Google Colab [example](https://github.com/milvus-io/milvus-lite/blob/main/examples/example.ipynb)
- Jupyter Notebook

Here's also a list of verified OS types where Milvus Lite can successfully build and run:
- Ubuntu >= 18.04 (x86_64)
- CentOS >= 7.0 (x86_64)
- MacOS >= 11.0 (Apple Silicon)

*NOTE*
* For linux we use manylinux2014 as the base image, so it should be able to run on most linux distributions.
* Milvus Lite can also run on **Windows**. However, this is not strictly verified.

## Installation

Milvus Lite is available on PyPI. You can install it via `pip` for Python 3.6+:

```bash
$ python3 -m pip install milvus
```

Or, install with client(pymilvus):
```bash
$ python3 -m pip install "milvus[client]"
```
Note: pymilvus now requires Python 3.7+

## Usage

### Import as Python library
Simply import `milvus.default_server`.

```python
from milvus import default_server
from pymilvus import connections, utility

# (OPTIONAL) Set if you want store all related data to specific location
# Default location:
#   %APPDATA%/milvus-io/milvus-server on windows
#   ~/.milvus-io/milvus-server on linux
# default_server.set_base_dir('milvus_data')

# (OPTIONAL) if you want cleanup previous data
# default_server.cleanup()

# Start you milvus server
default_server.start()

# Now you could connect with localhost and the given port
# Port is defined by default_server.listen_port
connections.connect(host='127.0.0.1', port=default_server.listen_port)

# Check if the server is ready.
print(utility.get_server_version())
```

### CLI milvus-server

You could also use the `milvus-server` command to start the server.

```bash
$ milvus-server
```

The full options cloud be found by `milvus-server --help`.


## Advanced usage

### Debug startup

You could use `debug_server` instead of `default_server` for checking startup failures.

```python
from milvus import debug_server
```

and you could also try create server instance by your self

```python
from milvus import MilvusServer

server = MilvusServer(debug=True)
```

If you're using CLI `milvus-server`, you could use `--debug` to enable debug mode.

```bash
$ milvus-server --debug
```

### Configurations for Milvus
Milvus Lite could set configure by API as well as by CLI. We seperate the configurations into two parts: `basic` and `extra`.

#### The basic configurations
You could find available configurations by `milvus-server --help` for got the list of `basic` configurations.

These basic configurations including:
- Some listen ports for service, e.g. `--proxy-port` for specifying the port of proxy service.
- Some storage configurations, e.g. `--data` for specifying the data directory.
- Some log configurations. e.g. `--system-log-level` for specifying the log level.

If you using Python API, you could set these configurations by `MilvusServer.config.set` method.

```python
# this have the same effect as `milvus-server --system-log-level info`
default_server.config.set('system_log_level', 'info')
```

All configuable basic configurations could be found in config yaml template, which is installed with milvus package.

#### The extra configurations
Other configurations are `extra` configurations, which could also be set by `MilvusServer.config.set` method.

for example, if we want to set `dataCoord.segment.maxSize` to 1024, we could do:

```python
default_server.config.set('dataCoord.segment.maxSize', 1024)
```

or by CLI:

``` bash
milvus-server --extra-config dataCoord.segment.maxSize=1024
```

Both of them will update the content of Milvus config yaml with:
``` yaml
dataCoord:
  segment:
    maxSize: 1024
```

### Context

You could close server while you not need it anymore.
Or, you're able to using `with` context to start/stop it.

```python
from milvus import default_server

with default_server:
    # milvus started, using default server here
    ...
```

### Data and Log Persistence

By default all data and logs are stored in the following locations: `~/.milvus.io/milvus-server/VERSION` (VERSION is the versiong string of Milvus Lite).

You could also set it at runtime(before the server started), by Python code:

```python
from milvus import default_server
default_server.set_base_dir('milvus_data')
```

Or with CLI:

```bash
$ milvus-server --data milvus_data
```

### Working with PyMilvus

Milvus Lite could be run without pymilvus if you just want run as a server.
You could also install with extras `client` to get pymilvus.

```bash
$ python3 -m pip install "milvus[client]"
```

## Examples

Milvus Lite is friendly with jupyter notebook, you could find more examples under [examples](https://github.com/milvus-io/milvus-lite/blob/main/examples) folder.

## 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
When you use or develop milvus-lite, if you find any bug, please report it to us. You could submit an issue in [milvus-lite](
https://github.com/milvus-io/milvus-lite/issues/new/choose) or report you [milvus](https://github.com/milvus-io/milvus/issues/new/choose) repo if you think is a Milvus issue.

## 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",
    "name": "milvus",
    "maintainer": "Ji Bin",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "matrixji@live.com",
    "keywords": "Milvus,Embeded Milvus,Milvus Server",
    "author": "Milvus Team",
    "author_email": "milvus-team@zilliz.com",
    "download_url": "",
    "platform": null,
    "description": "# Milvus Lite\n\n[![PyPI Version](https://img.shields.io/pypi/v/milvus.svg)](https://pypi.python.org/pypi/milvus)\n\n## Introduction\n\nMilvus Lite is a lightweight version of Milvus that can be embedded into your Python application. It is a single binary that can be easily installed and run on your machine.\n\nIt could be imported as a Python library, as well as use it as a command standalone server.\n\nThanks to Milvus standalone version could be run with embedded etcd and local storage, Milvus Lite does not have any other dependencies.\n\nEverything you do with Milvus Lite, every piece of code you write for Milvus Lite can be safely migrated to other forms of Milvus (standalone version, cluster version, cloud version, etc.).\n\nPlease note that it is not suggested to use Milvus Lite in a production environment. Consider using Milvus clustered or the fully managed Milvus on Cloud. \n\n\n## Requirements\n\nMilvus Lite is available in:\n- Google Colab [example](https://github.com/milvus-io/milvus-lite/blob/main/examples/example.ipynb)\n- Jupyter Notebook\n\nHere's also a list of verified OS types where Milvus Lite can successfully build and run:\n- Ubuntu >= 18.04 (x86_64)\n- CentOS >= 7.0 (x86_64)\n- MacOS >= 11.0 (Apple Silicon)\n\n*NOTE*\n* For linux we use manylinux2014 as the base image, so it should be able to run on most linux distributions.\n* Milvus Lite can also run on **Windows**. However, this is not strictly verified.\n\n## Installation\n\nMilvus Lite is available on PyPI. You can install it via `pip` for Python 3.6+:\n\n```bash\n$ python3 -m pip install milvus\n```\n\nOr, install with client(pymilvus):\n```bash\n$ python3 -m pip install \"milvus[client]\"\n```\nNote: pymilvus now requires Python 3.7+\n\n## Usage\n\n### Import as Python library\nSimply import `milvus.default_server`.\n\n```python\nfrom milvus import default_server\nfrom pymilvus import connections, utility\n\n# (OPTIONAL) Set if you want store all related data to specific location\n# Default location:\n#   %APPDATA%/milvus-io/milvus-server on windows\n#   ~/.milvus-io/milvus-server on linux\n# default_server.set_base_dir('milvus_data')\n\n# (OPTIONAL) if you want cleanup previous data\n# default_server.cleanup()\n\n# Start you milvus server\ndefault_server.start()\n\n# Now you could connect with localhost and the given port\n# Port is defined by default_server.listen_port\nconnections.connect(host='127.0.0.1', port=default_server.listen_port)\n\n# Check if the server is ready.\nprint(utility.get_server_version())\n```\n\n### CLI milvus-server\n\nYou could also use the `milvus-server` command to start the server.\n\n```bash\n$ milvus-server\n```\n\nThe full options cloud be found by `milvus-server --help`.\n\n\n## Advanced usage\n\n### Debug startup\n\nYou could use `debug_server` instead of `default_server` for checking startup failures.\n\n```python\nfrom milvus import debug_server\n```\n\nand you could also try create server instance by your self\n\n```python\nfrom milvus import MilvusServer\n\nserver = MilvusServer(debug=True)\n```\n\nIf you're using CLI `milvus-server`, you could use `--debug` to enable debug mode.\n\n```bash\n$ milvus-server --debug\n```\n\n### Configurations for Milvus\nMilvus Lite could set configure by API as well as by CLI. We seperate the configurations into two parts: `basic` and `extra`.\n\n#### The basic configurations\nYou could find available configurations by `milvus-server --help` for got the list of `basic` configurations.\n\nThese basic configurations including:\n- Some listen ports for service, e.g. `--proxy-port` for specifying the port of proxy service.\n- Some storage configurations, e.g. `--data` for specifying the data directory.\n- Some log configurations. e.g. `--system-log-level` for specifying the log level.\n\nIf you using Python API, you could set these configurations by `MilvusServer.config.set` method.\n\n```python\n# this have the same effect as `milvus-server --system-log-level info`\ndefault_server.config.set('system_log_level', 'info')\n```\n\nAll configuable basic configurations could be found in config yaml template, which is installed with milvus package.\n\n#### The extra configurations\nOther configurations are `extra` configurations, which could also be set by `MilvusServer.config.set` method.\n\nfor example, if we want to set `dataCoord.segment.maxSize` to 1024, we could do:\n\n```python\ndefault_server.config.set('dataCoord.segment.maxSize', 1024)\n```\n\nor by CLI:\n\n``` bash\nmilvus-server --extra-config dataCoord.segment.maxSize=1024\n```\n\nBoth of them will update the content of Milvus config yaml with:\n``` yaml\ndataCoord:\n  segment:\n    maxSize: 1024\n```\n\n### Context\n\nYou could close server while you not need it anymore.\nOr, you're able to using `with` context to start/stop it.\n\n```python\nfrom milvus import default_server\n\nwith default_server:\n    # milvus started, using default server here\n    ...\n```\n\n### Data and Log Persistence\n\nBy default all data and logs are stored in the following locations: `~/.milvus.io/milvus-server/VERSION` (VERSION is the versiong string of Milvus Lite).\n\nYou could also set it at runtime(before the server started), by Python code:\n\n```python\nfrom milvus import default_server\ndefault_server.set_base_dir('milvus_data')\n```\n\nOr with CLI:\n\n```bash\n$ milvus-server --data milvus_data\n```\n\n### Working with PyMilvus\n\nMilvus Lite could be run without pymilvus if you just want run as a server.\nYou could also install with extras `client` to get pymilvus.\n\n```bash\n$ python3 -m pip install \"milvus[client]\"\n```\n\n## Examples\n\nMilvus Lite is friendly with jupyter notebook, you could find more examples under [examples](https://github.com/milvus-io/milvus-lite/blob/main/examples) folder.\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\nWhen you use or develop milvus-lite, if you find any bug, please report it to us. You could submit an issue in [milvus-lite](\nhttps://github.com/milvus-io/milvus-lite/issues/new/choose) or report you [milvus](https://github.com/milvus-io/milvus/issues/new/choose) repo if you think is a Milvus issue.\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": "Apache-2.0",
    "summary": "Embeded Milvus",
    "version": "2.3.8",
    "project_urls": {
        "Homepage": "https://github.com/milvus-io/milvus-lite"
    },
    "split_keywords": [
        "milvus",
        "embeded milvus",
        "milvus server"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdd1c218a685dd97909205767b8933ad703b31d814885b4de80575c6e14000e0",
                "md5": "425771ea9f200dd5bc7ccfcf2f300a95",
                "sha256": "f86c1a5b00c8f3c6589affef8b04f45146496cf9c815a122e9a277698456cbb8"
            },
            "downloads": -1,
            "filename": "milvus-2.3.8-py3-none-macosx_12_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "425771ea9f200dd5bc7ccfcf2f300a95",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 36326293,
            "upload_time": "2024-02-17T14:57:51",
            "upload_time_iso_8601": "2024-02-17T14:57:51.146728Z",
            "url": "https://files.pythonhosted.org/packages/fd/d1/c218a685dd97909205767b8933ad703b31d814885b4de80575c6e14000e0/milvus-2.3.8-py3-none-macosx_12_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-17 14:57:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "milvus-io",
    "github_project": "milvus-lite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "milvus"
}
        
Elapsed time: 0.18229s