Name | llm-claude-3 JSON |
Version |
0.9
JSON |
| download |
home_page | None |
Summary | LLM access to Claude 3 by Anthropic |
upload_time | 2024-11-17 21:01:12 |
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/4e/9f/889a209ff7fc1ab0dd80c21a2c38222a64d477b1d5fcc361c264a9b91fb4/llm_claude_3-0.9.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.9",
"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": "385b2f6a261c6d2e8778a442be7ce9bc144ecbf84c7f5cce02a886f59d99203f",
"md5": "5b0a657629717fc2b6435a8aee0180f5",
"sha256": "cc3fb807fac6916d3c4b544e2c1852c2b4639b5e5774ec524a69a1a2e01dc212"
},
"downloads": -1,
"filename": "llm_claude_3-0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5b0a657629717fc2b6435a8aee0180f5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9079,
"upload_time": "2024-11-17T21:01:10",
"upload_time_iso_8601": "2024-11-17T21:01:10.270822Z",
"url": "https://files.pythonhosted.org/packages/38/5b/2f6a261c6d2e8778a442be7ce9bc144ecbf84c7f5cce02a886f59d99203f/llm_claude_3-0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4e9f889a209ff7fc1ab0dd80c21a2c38222a64d477b1d5fcc361c264a9b91fb4",
"md5": "ce310ece2b6261ffa63840cc779613c2",
"sha256": "f400be32111cd6fca21674b92285f30d2ca57d99e7424e343c83e6fec30de38e"
},
"downloads": -1,
"filename": "llm_claude_3-0.9.tar.gz",
"has_sig": false,
"md5_digest": "ce310ece2b6261ffa63840cc779613c2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9646,
"upload_time": "2024-11-17T21:01:12",
"upload_time_iso_8601": "2024-11-17T21:01:12.097298Z",
"url": "https://files.pythonhosted.org/packages/4e/9f/889a209ff7fc1ab0dd80c21a2c38222a64d477b1d5fcc361c264a9b91fb4/llm_claude_3-0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-17 21:01:12",
"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"
}