llm-embed-onnx


Namellm-embed-onnx JSON
Version 0.1 PyPI version JSON
download
home_page
SummaryRun embedding models using ONNX
upload_time2024-01-28 22:22:47
maintainer
docs_urlNone
authorSimon Willison
requires_python>=3.9
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # llm-embed-onnx

[![PyPI](https://img.shields.io/pypi/v/llm-embed-onnx.svg)](https://pypi.org/project/llm-embed-onnx/)
[![Changelog](https://img.shields.io/github/v/release/simonw/llm-embed-onnx?include_prereleases&label=changelog)](https://github.com/simonw/llm-embed-onnx/releases)
[![Tests](https://github.com/simonw/llm-embed-onnx/actions/workflows/test.yml/badge.svg)](https://github.com/simonw/llm-embed-onnx/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/llm-embed-onnx/blob/main/LICENSE)

Run embedding models using ONNX

This LLM plugin is a wrapper around [onnx_embedding_models](https://github.com/taylorai/onnx_embedding_models) by Benjamin Anderson.

## Installation

Install this plugin in the same environment as [LLM](https://llm.datasette.io/).
```bash
llm install llm-embed-onnx
```
## Usage

This plugin adds the following embedding models, which can be listed using `llm embed-models`:

```
onnx-bge-micro
onnx-gte-tiny
onnx-minilm-l6
onnx-minilm-l12
onnx-bge-small
onnx-bge-base
onnx-bge-large
```

You can run any of these models using `llm embed` command:

```bash
llm embed -m onnx-bge-micro -c "Example content"
```
This will output a 384 length JSON array of floating point numbers, starting:
```
[-0.03910085942622519, -0.0030843335461659795, 0.032797761260860724,
```
The first time you use any of these models the model will be downloaded to the `llm_embed_onnx` directory in your [LLM data directory](https://llm.datasette.io/en/stable/setup.html#setting-a-custom-directory-location). On macOS this defaults to:

`~/Library/Application Support/io.datasette.llm/llm_embed_onnx`

For more on how to use these embedding models see [the LLM embeddings documentation](https://llm.datasette.io/en/stable/embeddings/index.html).

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd llm-embed-onnx
python3 -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
llm install -e '.[test]'
```
To run the tests:
```bash
pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "llm-embed-onnx",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Simon Willison",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/3d/34/1d5c0f5ed5c34a0ee04468d3e149c827280e97c08013fe48669b5e3ed100/llm-embed-onnx-0.1.tar.gz",
    "platform": null,
    "description": "# llm-embed-onnx\n\n[![PyPI](https://img.shields.io/pypi/v/llm-embed-onnx.svg)](https://pypi.org/project/llm-embed-onnx/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/llm-embed-onnx?include_prereleases&label=changelog)](https://github.com/simonw/llm-embed-onnx/releases)\n[![Tests](https://github.com/simonw/llm-embed-onnx/actions/workflows/test.yml/badge.svg)](https://github.com/simonw/llm-embed-onnx/actions/workflows/test.yml)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/llm-embed-onnx/blob/main/LICENSE)\n\nRun embedding models using ONNX\n\nThis LLM plugin is a wrapper around [onnx_embedding_models](https://github.com/taylorai/onnx_embedding_models) by Benjamin Anderson.\n\n## Installation\n\nInstall this plugin in the same environment as [LLM](https://llm.datasette.io/).\n```bash\nllm install llm-embed-onnx\n```\n## Usage\n\nThis plugin adds the following embedding models, which can be listed using `llm embed-models`:\n\n```\nonnx-bge-micro\nonnx-gte-tiny\nonnx-minilm-l6\nonnx-minilm-l12\nonnx-bge-small\nonnx-bge-base\nonnx-bge-large\n```\n\nYou can run any of these models using `llm embed` command:\n\n```bash\nllm embed -m onnx-bge-micro -c \"Example content\"\n```\nThis will output a 384 length JSON array of floating point numbers, starting:\n```\n[-0.03910085942622519, -0.0030843335461659795, 0.032797761260860724,\n```\nThe first time you use any of these models the model will be downloaded to the `llm_embed_onnx` directory in your [LLM data directory](https://llm.datasette.io/en/stable/setup.html#setting-a-custom-directory-location). On macOS this defaults to:\n\n`~/Library/Application Support/io.datasette.llm/llm_embed_onnx`\n\nFor more on how to use these embedding models see [the LLM embeddings documentation](https://llm.datasette.io/en/stable/embeddings/index.html).\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd llm-embed-onnx\npython3 -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\nllm install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Run embedding models using ONNX",
    "version": "0.1",
    "project_urls": {
        "CI": "https://github.com/simonw/llm-embed-onnx/actions",
        "Changelog": "https://github.com/simonw/llm-embed-onnx/releases",
        "Homepage": "https://github.com/simonw/llm-embed-onnx",
        "Issues": "https://github.com/simonw/llm-embed-onnx/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4346f2c5df1d94e783874aa5db1bfbb80e88893dde198377a4fe501999baeec5",
                "md5": "8ff993d7018c5df9fd481384f9397ec7",
                "sha256": "946a9694f046f09965e12d481220dc8a146b0f6bbabe5f37457ebe2b2d4431f0"
            },
            "downloads": -1,
            "filename": "llm_embed_onnx-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ff993d7018c5df9fd481384f9397ec7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7382,
            "upload_time": "2024-01-28T22:22:46",
            "upload_time_iso_8601": "2024-01-28T22:22:46.954191Z",
            "url": "https://files.pythonhosted.org/packages/43/46/f2c5df1d94e783874aa5db1bfbb80e88893dde198377a4fe501999baeec5/llm_embed_onnx-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d341d5c0f5ed5c34a0ee04468d3e149c827280e97c08013fe48669b5e3ed100",
                "md5": "4f5d51616f16ddaf3971e4dc24c0243c",
                "sha256": "6b0a5ed0876193aad023a63a72a976daf4fb9250471d573c222a46c94cab819c"
            },
            "downloads": -1,
            "filename": "llm-embed-onnx-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4f5d51616f16ddaf3971e4dc24c0243c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7122,
            "upload_time": "2024-01-28T22:22:47",
            "upload_time_iso_8601": "2024-01-28T22:22:47.857152Z",
            "url": "https://files.pythonhosted.org/packages/3d/34/1d5c0f5ed5c34a0ee04468d3e149c827280e97c08013fe48669b5e3ed100/llm-embed-onnx-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-28 22:22:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "simonw",
    "github_project": "llm-embed-onnx",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "llm-embed-onnx"
}
        
Elapsed time: 0.92147s