1
- # llm-claude-3
1
+ # llm-anthropic
2
2
3
- [ ![ PyPI] ( https://img.shields.io/pypi/v/llm-claude-3 .svg )] ( https://pypi.org/project/llm-claude-3 / )
4
- [ ![ Changelog] ( https://img.shields.io/github/v/release/simonw/llm-claude-3 ?include_prereleases&label=changelog )] ( https://github.com/simonw/llm-claude-3 /releases )
5
- [ ![ 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 )
6
- [ ![ License] ( https://img.shields.io/badge/license-Apache%202.0-blue.svg )] ( https://github.com/simonw/llm-claude-3 /blob/main/LICENSE )
3
+ [ ![ PyPI] ( https://img.shields.io/pypi/v/llm-anthropic .svg )] ( https://pypi.org/project/llm-anthropic / )
4
+ [ ![ Changelog] ( https://img.shields.io/github/v/release/simonw/llm-anthropic ?include_prereleases&label=changelog )] ( https://github.com/simonw/llm-anthropic /releases )
5
+ [ ![ Tests] ( https://github.com/simonw/llm-anthropic /actions/workflows/test.yml/badge.svg )] ( https://github.com/simonw/llm-anthropic /actions/workflows/test.yml )
6
+ [ ![ License] ( https://img.shields.io/badge/license-Apache%202.0-blue.svg )] ( https://github.com/simonw/llm-anthropic /blob/main/LICENSE )
7
7
8
- LLM access to Claude 3 by Anthropic
8
+ LLM access to models by Anthropic, including the Claude series
9
9
10
10
## Installation
11
11
12
12
Install this plugin in the same environment as [ LLM] ( https://llm.datasette.io/ ) .
13
13
``` bash
14
- llm install llm-claude-3
14
+ llm install llm-anthropic
15
15
```
16
16
17
17
## Usage
18
18
19
- First, set [ an API key] ( https://console.anthropic.com/settings/keys ) for Claude 3 :
19
+ First, set [ an API key] ( https://console.anthropic.com/settings/keys ) for Anthropic :
20
20
``` bash
21
- llm keys set claude
21
+ llm keys set anthropic
22
22
# Paste key here
23
23
```
24
24
@@ -28,21 +28,29 @@ Run `llm models` to list the models, and `llm models --options` to include a lis
28
28
29
29
Run prompts like this:
30
30
``` bash
31
- llm -m claude-3.5-sonnet ' Fun facts about pelicans'
32
- llm -m claude-3.5-haiku ' Fun facts about armadillos'
33
- llm -m claude-3-opus ' Fun facts about squirrels'
31
+ llm -m anthropic/claude-3.5-sonnet ' Fun facts about pelicans'
32
+ llm -m anthropic/claude-3.5-haiku ' Fun facts about armadillos'
33
+ llm -m anthropic/claude-3-opus ' Fun facts about squirrels'
34
+ ```
35
+ Images are supported too, for models other than Claude 3.5 Haiku:
36
+ ``` bash
37
+ llm -m anthropic/claude-3.5-sonnet ' describe this image' -a https://static.simonwillison.net/static/2024/pelicans.jpg
38
+ llm -m anthropic/claude-3-haiku ' extract text' -a page.png
34
39
```
35
- Images are supported too :
40
+ Claude 3.5 Sonnet can handle PDF files :
36
41
``` bash
37
- llm -m claude-3.5-sonnet ' describe this image' -a https://static.simonwillison.net/static/2024/pelicans.jpg
38
- llm -m claude-3-haiku ' extract text' -a page.png
42
+ llm -m anthropic/claude-3.5-sonnet ' extract text' -a page.pdf
43
+ ```
44
+ The plugin sets up ` claude-3.5-sonnet ` and similar as aliases, usable like this:
45
+ ``` bash
46
+ llm -m claude-3.5-sonnet ' Fun facts about pelicans'
39
47
```
40
48
41
49
## Development
42
50
43
51
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
44
52
``` bash
45
- cd llm-claude-3
53
+ cd llm-anthropic
46
54
python3 -m venv venv
47
55
source venv/bin/activate
48
56
```
0 commit comments