Name | llm-claude-3 JSON |
Version |
0.10
JSON |
| download |
home_page | None |
Summary | LLM access to Claude 3 by Anthropic |
upload_time | 2024-12-02 00:12:16 |
maintainer | None |
docs_url | None |
author | Simon Willison |
requires_python | None |
license | Apache-2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# llm-claude-3
[![PyPI](https://img.shields.io/pypi/v/llm-claude-3.svg)](https://pypi.org/project/llm-claude-3/)
[![Changelog](https://img.shields.io/github/v/release/simonw/llm-claude-3?include_prereleases&label=changelog)](https://github.com/simonw/llm-claude-3/releases)
[![Tests](https://github.com/simonw/llm-claude-3/actions/workflows/test.yml/badge.svg)](https://github.com/simonw/llm-claude-3/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/llm-claude-3/blob/main/LICENSE)
LLM access to Claude 3 by Anthropic
## Installation
Install this plugin in the same environment as [LLM](https://llm.datasette.io/).
```bash
llm install llm-claude-3
```
## Usage
First, set [an API key](https://console.anthropic.com/settings/keys) for Claude 3:
```bash
llm keys set claude
# Paste key here
```
You can also set the key in the environment variable `ANTHROPIC_API_KEY`
Run `llm models` to list the models, and `llm models --options` to include a list of their options.
Run prompts like this:
```bash
llm -m claude-3.5-sonnet 'Fun facts about pelicans'
llm -m claude-3.5-haiku 'Fun facts about armadillos'
llm -m claude-3-opus 'Fun facts about squirrels'
```
Images are supported too:
```bash
llm -m claude-3.5-sonnet 'describe this image' -a https://static.simonwillison.net/static/2024/pelicans.jpg
llm -m claude-3-haiku 'extract text' -a page.png
```
## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd llm-claude-3
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
```
This project uses [pytest-recording](https://github.com/kiwicom/pytest-recording) to record Anthropic API responses for the tests.
If you add a new test that calls the API you can capture the API response like this:
```bash
PYTEST_ANTHROPIC_API_KEY="$(llm keys get claude)" pytest --record-mode once
```
You will need to have stored a valid Anthropic API key using this command first:
```bash
llm keys set claude
# Paste key here
```
Raw data
{
"_id": null,
"home_page": null,
"name": "llm-claude-3",
"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/66/2b/b58bd4aeb6ff0c63e634e925f215ead8e59f98ba9366cee2c346818f6ff8/llm_claude_3-0.10.tar.gz",
"platform": null,
"description": "# llm-claude-3\n\n[![PyPI](https://img.shields.io/pypi/v/llm-claude-3.svg)](https://pypi.org/project/llm-claude-3/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/llm-claude-3?include_prereleases&label=changelog)](https://github.com/simonw/llm-claude-3/releases)\n[![Tests](https://github.com/simonw/llm-claude-3/actions/workflows/test.yml/badge.svg)](https://github.com/simonw/llm-claude-3/actions/workflows/test.yml)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/llm-claude-3/blob/main/LICENSE)\n\nLLM access to Claude 3 by Anthropic\n\n## Installation\n\nInstall this plugin in the same environment as [LLM](https://llm.datasette.io/).\n```bash\nllm install llm-claude-3\n```\n\n## Usage\n\nFirst, set [an API key](https://console.anthropic.com/settings/keys) for Claude 3:\n```bash\nllm keys set claude\n# Paste key here\n```\n\nYou can also set the key in the environment variable `ANTHROPIC_API_KEY`\n\nRun `llm models` to list the models, and `llm models --options` to include a list of their options.\n\nRun prompts like this:\n```bash\nllm -m claude-3.5-sonnet 'Fun facts about pelicans'\nllm -m claude-3.5-haiku 'Fun facts about armadillos'\nllm -m claude-3-opus 'Fun facts about squirrels'\n```\nImages are supported too:\n```bash\nllm -m claude-3.5-sonnet 'describe this image' -a https://static.simonwillison.net/static/2024/pelicans.jpg\nllm -m claude-3-haiku 'extract text' -a page.png\n```\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd llm-claude-3\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\nThis project uses [pytest-recording](https://github.com/kiwicom/pytest-recording) to record Anthropic API responses for the tests.\n\nIf you add a new test that calls the API you can capture the API response like this:\n```bash\nPYTEST_ANTHROPIC_API_KEY=\"$(llm keys get claude)\" pytest --record-mode once\n```\nYou will need to have stored a valid Anthropic API key using this command first:\n```bash\nllm keys set claude\n# Paste key here\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "LLM access to Claude 3 by Anthropic",
"version": "0.10",
"project_urls": {
"CI": "https://github.com/simonw/llm-claude-3/actions",
"Changelog": "https://github.com/simonw/llm-claude-3/releases",
"Homepage": "https://github.com/simonw/llm-claude-3",
"Issues": "https://github.com/simonw/llm-claude-3/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f62cea53305c35a6ea4d009722615c2a4c991e7de9cfbeb8f7f7b99d04a333a8",
"md5": "0c0e2e78ec9941f571ecfba6d02f11ae",
"sha256": "77c089cc5c7248c30d08fde18d7041ee462bb5e5a15b4169b29039bf19240538"
},
"downloads": -1,
"filename": "llm_claude_3-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0c0e2e78ec9941f571ecfba6d02f11ae",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9161,
"upload_time": "2024-12-02T00:12:14",
"upload_time_iso_8601": "2024-12-02T00:12:14.098101Z",
"url": "https://files.pythonhosted.org/packages/f6/2c/ea53305c35a6ea4d009722615c2a4c991e7de9cfbeb8f7f7b99d04a333a8/llm_claude_3-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "662bb58bd4aeb6ff0c63e634e925f215ead8e59f98ba9366cee2c346818f6ff8",
"md5": "60d7d4ff7e43463e9ae9c8091eda3e59",
"sha256": "5a792b74102454e7ba62c97b661f9836e7ab2511a6bb9821e0769a921efb0ad3"
},
"downloads": -1,
"filename": "llm_claude_3-0.10.tar.gz",
"has_sig": false,
"md5_digest": "60d7d4ff7e43463e9ae9c8091eda3e59",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9712,
"upload_time": "2024-12-02T00:12:16",
"upload_time_iso_8601": "2024-12-02T00:12:16.440348Z",
"url": "https://files.pythonhosted.org/packages/66/2b/b58bd4aeb6ff0c63e634e925f215ead8e59f98ba9366cee2c346818f6ff8/llm_claude_3-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-02 00:12:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "simonw",
"github_project": "llm-claude-3",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "llm-claude-3"
}