llm-togetherai


Namellm-togetherai JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryLLM plugin for models hosted by Together AI
upload_time2025-07-15 23:37:09
maintainerNone
docs_urlNone
authorRajashekar Chintalapati
requires_python>=3.9
licenseNone
keywords llm ai together language-models plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # llm-togetherai

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

[LLM](https://llm.datasette.io/) plugin for models hosted by [Together AI](https://www.together.ai/)

## 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-togetherai
```

## Configuration

You will need an API key from Together AI. You can [obtain one here](https://api.together.xyz/settings/api-keys).

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

```bash
llm keys set together
```
```
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:
```
together: together/meta-llama/Llama-2-7b-chat-hf
together: together/meta-llama/Llama-2-13b-chat-hf
together: together/meta-llama/Llama-2-70b-chat-hf
together: together/mistralai/Mistral-7B-Instruct-v0.1
together: together/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO
...
```

To run a prompt against a model, pass its full model ID to the `-m` option, like this:
```bash
llm -m together/meta-llama/Llama-2-7b-chat-hf "Five creative names for a pet robot"
```

You can set a shorter alias for a model using the `llm aliases` command like so:
```bash
llm aliases set llama2-7b together/meta-llama/Llama-2-7b-chat-hf
```
Now you can prompt the model using:
```bash
cat llm_togetherai.py | llm -m llama2-7b -s 'write some pytest tests for this'
```

### Vision models

Some Together AI models can accept image attachments. Run this command:

```bash
llm models --options -q together
```
And look for models that list these attachment types:

```
  Attachment types:
    image/gif, image/jpeg, image/png, image/webp
```

You can feed these models images as URLs or file paths, for example:

```bash
curl https://static.simonwillison.net/static/2024/pelicans.jpg | llm \
    -m together/meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo 'describe this image' -a -
```

### Listing models

The `llm models -q together` command will display all available models, or you can use this command to see more detailed information:

```bash
llm together models
```
Output starts like this:
```yaml
- id: meta-llama/Llama-2-7b-chat-hf
  name: Llama-2-7b-chat-hf
  context_length: 4,096
  type: chat
  organization: Together
  pricing: input $0.2/M, output $0.2/M

- id: meta-llama/Llama-2-13b-chat-hf
  name: Llama-2-13b-chat-hf
  context_length: 4,096
  type: chat
  organization: Together
  pricing: input $0.3/M, output $0.3/M
```

Add `--json` to get back JSON instead:
```bash
llm together models --json
```

### Refreshing the model cache

The plugin caches the list of available models for 1 hour. To refresh this cache manually:

```bash
llm together refresh
```

This will fetch the latest models from the Together AI API and update the local cache.

## API Endpoint

This plugin uses the Together AI API endpoint:
```
https://api.together.xyz/v1/models
```

The models are cached locally in your LLM user directory to improve performance and reduce API calls.

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd llm-togetherai
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
```

## License

Apache 2.0

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llm-togetherai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "llm, ai, together, language-models, plugin",
    "author": "Rajashekar Chintalapati",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/10/4d/ed3209596ae41ded30510c38d0fcdbacd728a02bdc2a22112e73a8181066/llm_togetherai-0.1.0.tar.gz",
    "platform": null,
    "description": "# llm-togetherai\n\n[![PyPI](https://img.shields.io/pypi/v/llm-togetherai.svg)](https://pypi.org/project/llm-togetherai/)\n[![Changelog](https://img.shields.io/github/v/release/rajashekar/llm-togetherai?include_prereleases&label=changelog)](https://github.com/rajashekar/llm-togetherai/releases)\n[![Tests](https://github.com/rajashekar/llm-togetherai/workflows/Test/badge.svg)](https://github.com/rajashekar/llm-togetherai/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/rajashekar/llm-togetherai/blob/main/LICENSE)\n\n[LLM](https://llm.datasette.io/) plugin for models hosted by [Together AI](https://www.together.ai/)\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-togetherai\n```\n\n## Configuration\n\nYou will need an API key from Together AI. You can [obtain one here](https://api.together.xyz/settings/api-keys).\n\nYou can set that as an environment variable called `TOGETHER_API_KEY`, or add it to the `llm` set of saved keys using:\n\n```bash\nllm keys set together\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```\ntogether: together/meta-llama/Llama-2-7b-chat-hf\ntogether: together/meta-llama/Llama-2-13b-chat-hf\ntogether: together/meta-llama/Llama-2-70b-chat-hf\ntogether: together/mistralai/Mistral-7B-Instruct-v0.1\ntogether: together/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO\n...\n```\n\nTo run a prompt against a model, pass its full model ID to the `-m` option, like this:\n```bash\nllm -m together/meta-llama/Llama-2-7b-chat-hf \"Five creative names for a pet robot\"\n```\n\nYou can set a shorter alias for a model using the `llm aliases` command like so:\n```bash\nllm aliases set llama2-7b together/meta-llama/Llama-2-7b-chat-hf\n```\nNow you can prompt the model using:\n```bash\ncat llm_togetherai.py | llm -m llama2-7b -s 'write some pytest tests for this'\n```\n\n### Vision models\n\nSome Together AI models can accept image attachments. Run this command:\n\n```bash\nllm models --options -q together\n```\nAnd look for models that list these attachment types:\n\n```\n  Attachment types:\n    image/gif, image/jpeg, image/png, image/webp\n```\n\nYou can feed these models images as URLs or file paths, for example:\n\n```bash\ncurl https://static.simonwillison.net/static/2024/pelicans.jpg | llm \\\n    -m together/meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo 'describe this image' -a -\n```\n\n### Listing models\n\nThe `llm models -q together` command will display all available models, or you can use this command to see more detailed information:\n\n```bash\nllm together models\n```\nOutput starts like this:\n```yaml\n- id: meta-llama/Llama-2-7b-chat-hf\n  name: Llama-2-7b-chat-hf\n  context_length: 4,096\n  type: chat\n  organization: Together\n  pricing: input $0.2/M, output $0.2/M\n\n- id: meta-llama/Llama-2-13b-chat-hf\n  name: Llama-2-13b-chat-hf\n  context_length: 4,096\n  type: chat\n  organization: Together\n  pricing: input $0.3/M, output $0.3/M\n```\n\nAdd `--json` to get back JSON instead:\n```bash\nllm together models --json\n```\n\n### Refreshing the model cache\n\nThe plugin caches the list of available models for 1 hour. To refresh this cache manually:\n\n```bash\nllm together refresh\n```\n\nThis will fetch the latest models from the Together AI API and update the local cache.\n\n## API Endpoint\n\nThis plugin uses the Together AI API endpoint:\n```\nhttps://api.together.xyz/v1/models\n```\n\nThe models are cached locally in your LLM user directory to improve performance and reduce API calls.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd llm-togetherai\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\n## License\n\nApache 2.0\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "LLM plugin for models hosted by Together AI",
    "version": "0.1.0",
    "project_urls": {
        "CI": "https://github.com/rajashekar/llm-togetherai/actions",
        "Changelog": "https://github.com/rajashekar/llm-togetherai/releases",
        "Homepage": "https://github.com/rajashekar/llm-togetherai",
        "Issues": "https://github.com/rajashekar/llm-togetherai/issues"
    },
    "split_keywords": [
        "llm",
        " ai",
        " together",
        " language-models",
        " plugin"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "879b2070418004dbdb63761d4d32870f328ed9ee247bab8736196ffcf1276036",
                "md5": "5a806f59a1d358bd4bf7bb8822657052",
                "sha256": "fdfd41bb613d9811cd8570d67ab45556ee618d52d3b45888e1bc56fcf4928d90"
            },
            "downloads": -1,
            "filename": "llm_togetherai-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5a806f59a1d358bd4bf7bb8822657052",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 10481,
            "upload_time": "2025-07-15T23:37:08",
            "upload_time_iso_8601": "2025-07-15T23:37:08.468217Z",
            "url": "https://files.pythonhosted.org/packages/87/9b/2070418004dbdb63761d4d32870f328ed9ee247bab8736196ffcf1276036/llm_togetherai-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "104ded3209596ae41ded30510c38d0fcdbacd728a02bdc2a22112e73a8181066",
                "md5": "b71829fee4938c88fac73bd406891142",
                "sha256": "57464f0c9a40476af05965b132c89e9256f8882718f3ae096a1537fc06805941"
            },
            "downloads": -1,
            "filename": "llm_togetherai-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b71829fee4938c88fac73bd406891142",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11059,
            "upload_time": "2025-07-15T23:37:09",
            "upload_time_iso_8601": "2025-07-15T23:37:09.865497Z",
            "url": "https://files.pythonhosted.org/packages/10/4d/ed3209596ae41ded30510c38d0fcdbacd728a02bdc2a22112e73a8181066/llm_togetherai-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 23:37:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rajashekar",
    "github_project": "llm-togetherai",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "llm-togetherai"
}
        
Elapsed time: 1.67327s