LLM access to Claude 3 by Anthropic
Project description
llm-claude-3
LLM access to Claude 3 by Anthropic
Installation
Install this plugin in the same environment as LLM.
llm install llm-claude-3
Usage
First, set an API key for Claude 3:
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:
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:
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:
cd llm-claude-3
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
llm install -e '.[test]'
To run the tests:
pytest
This project uses 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:
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:
llm keys set claude
# Paste key here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llm_claude_3-0.9.tar.gz
.
File metadata
- Download URL: llm_claude_3-0.9.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f400be32111cd6fca21674b92285f30d2ca57d99e7424e343c83e6fec30de38e |
|
MD5 | ce310ece2b6261ffa63840cc779613c2 |
|
BLAKE2b-256 | 4e9f889a209ff7fc1ab0dd80c21a2c38222a64d477b1d5fcc361c264a9b91fb4 |
Provenance
The following attestation bundles were made for llm_claude_3-0.9.tar.gz
:
Publisher:
publish.yml
on simonw/llm-claude-3
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
llm_claude_3-0.9.tar.gz
- Subject digest:
f400be32111cd6fca21674b92285f30d2ca57d99e7424e343c83e6fec30de38e
- Sigstore transparency entry: 149375952
- Sigstore integration time:
- Predicate type:
File details
Details for the file llm_claude_3-0.9-py3-none-any.whl
.
File metadata
- Download URL: llm_claude_3-0.9-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc3fb807fac6916d3c4b544e2c1852c2b4639b5e5774ec524a69a1a2e01dc212 |
|
MD5 | 5b0a657629717fc2b6435a8aee0180f5 |
|
BLAKE2b-256 | 385b2f6a261c6d2e8778a442be7ce9bc144ecbf84c7f5cce02a886f59d99203f |
Provenance
The following attestation bundles were made for llm_claude_3-0.9-py3-none-any.whl
:
Publisher:
publish.yml
on simonw/llm-claude-3
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
llm_claude_3-0.9-py3-none-any.whl
- Subject digest:
cc3fb807fac6916d3c4b544e2c1852c2b4639b5e5774ec524a69a1a2e01dc212
- Sigstore transparency entry: 149375953
- Sigstore integration time:
- Predicate type: