llm-anyscale-endpoints


Namellm-anyscale-endpoints JSON
Version 0.6 PyPI version JSON
download
home_pageNone
SummaryLLM plugin for models hosted by Anyscale Endpoints
upload_time2024-04-21 23:36:08
maintainerNone
docs_urlNone
authorSimon Willison
requires_pythonNone
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # llm-anyscale-endpoints

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

[LLM](https://llm.datasette.io/) plugin for models hosted by [Anyscale Endpoints](https://app.endpoints.anyscale.com/)

## Installation

First, [install the LLM command-line utility](https://llm.datasette.io/en/stable/setup.html).

Now install this plugin in the same environment as LLM.
```bash
llm install llm-anyscale-endpoints
```
## Configuration

You will need an API key from Anyscale Endpoints. You can [obtain one here](https://app.endpoints.anyscale.com/).

You can set that as an environment variable called `LLM_ANYSCALE_ENDPOINTS_KEY`, or add it to the `llm` set of saved keys using:

```bash
llm keys set anyscale-endpoints
```
```
Enter key: <paste key here>
```

## Usage

To list available models, run:
```bash
llm models list
```
You should see a list that looks something like this:
```
AnyscaleEndpoints: meta-llama/Llama-2-7b-chat-hf
AnyscaleEndpoints: meta-llama/Llama-2-13b-chat-hf
AnyscaleEndpoints: mistralai/Mixtral-8x7B-Instruct-v0.1
AnyscaleEndpoints: mistralai/Mistral-7B-Instruct-v0.1
AnyscaleEndpoints: meta-llama/Llama-2-70b-chat-hf
AnyscaleEndpoints: codellama/CodeLlama-70b-Instruct-hf
AnyscaleEndpoints: mistralai/Mixtral-8x22B-Instruct-v0.1
AnyscaleEndpoints: mlabonne/NeuralHermes-2.5-Mistral-7B
AnyscaleEndpoints: google/gemma-7b-it
```
To run a prompt against a model, pass its full model ID to the `-m` option, like this:
```bash
llm -m mistralai/Mixtral-8x22B-Instruct-v0.1 \
  'Five strident names for a pet walrus' \
  --system 'You love coming up with creative names for pets'
```
You can set a shorter alias for a model using the `llm aliases` command like so:
```bash
llm aliases set mix22b mistralai/Mixtral-8x22B-Instruct-v0.1
```
Now you can prompt Mixtral-8x22B-Instruct-v0.1 using the alias `mix22b`:
```bash
cat llm_anyscale_endpoints.py | \
  llm -m mix22b -s 'explain this code'
```

You can refresh the list of models by running:
```bash
llm anyscale-endpoints refresh
```
This will fetch the latest list of models from Anyscale Endpoints and story it in a local cache file.

## Development

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llm-anyscale-endpoints",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Simon Willison",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9d/33/48b9458838b148674f2abb4d847ea917939e8c9abe162ff2216f2513f893/llm_anyscale_endpoints-0.6.tar.gz",
    "platform": null,
    "description": "# llm-anyscale-endpoints\n\n[![PyPI](https://img.shields.io/pypi/v/llm-anyscale-endpoints.svg)](https://pypi.org/project/llm-anyscale-endpoints/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/llm-anyscale-endpoints?include_prereleases&label=changelog)](https://github.com/simonw/llm-anyscale-endpoints/releases)\n[![Tests](https://github.com/simonw/llm-anyscale-endpoints/workflows/Test/badge.svg)](https://github.com/simonw/llm-anyscale-endpoints/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/llm-anyscale-endpoints/blob/main/LICENSE)\n\n[LLM](https://llm.datasette.io/) plugin for models hosted by [Anyscale Endpoints](https://app.endpoints.anyscale.com/)\n\n## Installation\n\nFirst, [install the LLM command-line utility](https://llm.datasette.io/en/stable/setup.html).\n\nNow install this plugin in the same environment as LLM.\n```bash\nllm install llm-anyscale-endpoints\n```\n## Configuration\n\nYou will need an API key from Anyscale Endpoints. You can [obtain one here](https://app.endpoints.anyscale.com/).\n\nYou can set that as an environment variable called `LLM_ANYSCALE_ENDPOINTS_KEY`, or add it to the `llm` set of saved keys using:\n\n```bash\nllm keys set anyscale-endpoints\n```\n```\nEnter key: <paste key here>\n```\n\n## Usage\n\nTo list available models, run:\n```bash\nllm models list\n```\nYou should see a list that looks something like this:\n```\nAnyscaleEndpoints: meta-llama/Llama-2-7b-chat-hf\nAnyscaleEndpoints: meta-llama/Llama-2-13b-chat-hf\nAnyscaleEndpoints: mistralai/Mixtral-8x7B-Instruct-v0.1\nAnyscaleEndpoints: mistralai/Mistral-7B-Instruct-v0.1\nAnyscaleEndpoints: meta-llama/Llama-2-70b-chat-hf\nAnyscaleEndpoints: codellama/CodeLlama-70b-Instruct-hf\nAnyscaleEndpoints: mistralai/Mixtral-8x22B-Instruct-v0.1\nAnyscaleEndpoints: mlabonne/NeuralHermes-2.5-Mistral-7B\nAnyscaleEndpoints: google/gemma-7b-it\n```\nTo run a prompt against a model, pass its full model ID to the `-m` option, like this:\n```bash\nllm -m mistralai/Mixtral-8x22B-Instruct-v0.1 \\\n  'Five strident names for a pet walrus' \\\n  --system 'You love coming up with creative names for pets'\n```\nYou can set a shorter alias for a model using the `llm aliases` command like so:\n```bash\nllm aliases set mix22b mistralai/Mixtral-8x22B-Instruct-v0.1\n```\nNow you can prompt Mixtral-8x22B-Instruct-v0.1 using the alias `mix22b`:\n```bash\ncat llm_anyscale_endpoints.py | \\\n  llm -m mix22b -s 'explain this code'\n```\n\nYou can refresh the list of models by running:\n```bash\nllm anyscale-endpoints refresh\n```\nThis will fetch the latest list of models from Anyscale Endpoints and story it in a local cache file.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd llm-anyscale-endpoints\npython3 -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\npip install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "LLM plugin for models hosted by Anyscale Endpoints",
    "version": "0.6",
    "project_urls": {
        "CI": "https://github.com/simonw/llm-anyscale-endpoints/actions",
        "Changelog": "https://github.com/simonw/llm-anyscale-endpoints/releases",
        "Homepage": "https://github.com/simonw/llm-anyscale-endpoints",
        "Issues": "https://github.com/simonw/llm-anyscale-endpoints/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "191c64aea5735fca6630d9c8b2e6181996e87a49329babc1c75cc015fd0f812b",
                "md5": "a4a2e6062e4f4faeecf2d7a4dbde1d88",
                "sha256": "12bb01ccd13d98153c584b57a5ac765b0f15996d236811ae4ee612e512a685b8"
            },
            "downloads": -1,
            "filename": "llm_anyscale_endpoints-0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a4a2e6062e4f4faeecf2d7a4dbde1d88",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8058,
            "upload_time": "2024-04-21T23:36:07",
            "upload_time_iso_8601": "2024-04-21T23:36:07.441901Z",
            "url": "https://files.pythonhosted.org/packages/19/1c/64aea5735fca6630d9c8b2e6181996e87a49329babc1c75cc015fd0f812b/llm_anyscale_endpoints-0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d3348b9458838b148674f2abb4d847ea917939e8c9abe162ff2216f2513f893",
                "md5": "4a548921405f366fa4d94b0558c21e33",
                "sha256": "11c0c1ed42a6c16a25a92f4f756f122c39083af397f167e11b63151d060e1aa7"
            },
            "downloads": -1,
            "filename": "llm_anyscale_endpoints-0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "4a548921405f366fa4d94b0558c21e33",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7739,
            "upload_time": "2024-04-21T23:36:08",
            "upload_time_iso_8601": "2024-04-21T23:36:08.556617Z",
            "url": "https://files.pythonhosted.org/packages/9d/33/48b9458838b148674f2abb4d847ea917939e8c9abe162ff2216f2513f893/llm_anyscale_endpoints-0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-21 23:36:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "simonw",
    "github_project": "llm-anyscale-endpoints",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "llm-anyscale-endpoints"
}
        
Elapsed time: 0.27178s