simonw / llm-claude-3

LLM plugin for interacting with the Claude 3 family of models
Apache License 2.0
254 stars 23 forks source link

New Claude 3.5 Sonnet (3.5 Haiku coming soon) #17

Closed simonw closed 1 month ago

simonw commented 1 month ago

Model ID is claude-3-5-sonnet-20241022

There's also a claude-3-5-sonnet-latest alias, and a claude-3-opus-latest one too: https://docs.anthropic.com/en/docs/about-claude/models#model-names

CleanShot 2024-10-22 at 09 23 18@2x

The 3.5 Haiku model "will be released later this month".

simonw commented 1 month ago
$ llm -m claude-3.5-sonnet 'hi'       
Hello! How can I help you today?
$ llm -m claude-3.5-sonnet-latest 'hi'
Hi! How can I help you today?
$ llm -m claude-3-5-sonnet-20240620 'hi'
Hello! How can I assist you today? Feel free to ask me any questions or let me know if you need help with anything.
$ llm -m claude-3-5-sonnet-20241022 'hi'
Hello! How can I help you today?
$ llm -m claude-3-opus-latest 'hi'      
Hello! How can I assist you today?
sqlite-utils "$(llm logs path)" 'select * from responses order by id desc limit 5' | jq
[
  {
    "id": "01jatgsvng74y7qtk89rgm05tm",
    "model": "claude-3-opus-latest",
    "prompt": "hi",
    "system": null,
    "prompt_json": null,
    "options_json": "{\"max_tokens\": 4096, \"temperature\": 1.0}",
    "response": "Hello! How can I assist you today?",
    "response_json": "{\"id\": \"msg_01V8FG2G8Yfe2Wj3Wmg39ro1\", \"content\": [{\"text\": \"Hello! How can I assist you today?\", \"type\": \"text\"}], \"model\": \"claude-3-opus-20240229\", \"role\": \"assistant\", \"stop_reason\": \"end_turn\", \"stop_sequence\": null, \"type\": \"message\", \"usage\": {\"input_tokens\": 8, \"output_tokens\": 12}}",
    "conversation_id": "01jatgsvnddtanr4rg39ds2dz7",
    "duration_ms": 1121,
    "datetime_utc": "2024-10-22T16:26:15.498118"
  },
  {
    "id": "01jatgs11f20v7e899bjfcmc6a",
    "model": "claude-3-5-sonnet-20241022",
    "prompt": "hi",
    "system": null,
    "prompt_json": null,
    "options_json": "{\"max_tokens\": 8192, \"temperature\": 1.0}",
    "response": "Hello! How can I help you today?",
    "response_json": "{\"id\": \"msg_01TkJhana9ciJuuiAgkhM5Sz\", \"content\": [{\"text\": \"Hello! How can I help you today?\", \"type\": \"text\"}], \"model\": \"claude-3-5-sonnet-20241022\", \"role\": \"assistant\", \"stop_reason\": \"end_turn\", \"stop_sequence\": null, \"type\": \"message\", \"usage\": {\"input_tokens\": 8, \"output_tokens\": 12}}",
    "conversation_id": "01jatgs11demxna6fg58aj4vdq",
    "duration_ms": 620,
    "datetime_utc": "2024-10-22T16:25:48.735961"
  },
  {
    "id": "01jatgrsq0459rzkec7j0jecrz",
    "model": "claude-3-5-sonnet-20240620",
    "prompt": "hi",
    "system": null,
    "prompt_json": null,
    "options_json": "{\"max_tokens\": 8192, \"temperature\": 1.0}",
    "response": "Hello! How can I assist you today? Feel free to ask me any questions or let me know if you need help with anything.",
    "response_json": "{\"id\": \"msg_011HE596aHvZoGBxc7X19MPa\", \"content\": [{\"text\": \"Hello! How can I assist you today? Feel free to ask me any questions or let me know if you need help with anything.\", \"type\": \"text\"}], \"model\": \"claude-3-5-sonnet-20240620\", \"role\": \"assistant\", \"stop_reason\": \"end_turn\", \"stop_sequence\": null, \"type\": \"message\", \"usage\": {\"input_tokens\": 8, \"output_tokens\": 30}}",
    "conversation_id": "01jatgrspyhsfyj51ygwa6x8wj",
    "duration_ms": 909,
    "datetime_utc": "2024-10-22T16:25:40.944215"
  },
  {
    "id": "01jatgrcs949m74f0jckm8m2da",
    "model": "claude-3-5-sonnet-latest",
    "prompt": "hi",
    "system": null,
    "prompt_json": null,
    "options_json": "{\"max_tokens\": 8192, \"temperature\": 1.0}",
    "response": "Hi! How can I help you today?",
    "response_json": "{\"id\": \"msg_01Co9chQg1YXCZcR71Echx6B\", \"content\": [{\"text\": \"Hi! How can I help you today?\", \"type\": \"text\"}], \"model\": \"claude-3-5-sonnet-20241022\", \"role\": \"assistant\", \"stop_reason\": \"end_turn\", \"stop_sequence\": null, \"type\": \"message\", \"usage\": {\"input_tokens\": 8, \"output_tokens\": 12}}",
    "conversation_id": "01jatgrcs8dhq3q1entfxwrg5w",
    "duration_ms": 655,
    "datetime_utc": "2024-10-22T16:25:27.959412"
  },
  {
    "id": "01jatgr9hzk6vvegcnh3spqvpr",
    "model": "claude-3-5-sonnet-latest",
    "prompt": "hi",
    "system": null,
    "prompt_json": null,
    "options_json": "{\"max_tokens\": 8192, \"temperature\": 1.0}",
    "response": "Hello! How can I help you today?",
    "response_json": "{\"id\": \"msg_01J1oSNpufhh8vboqfLEEBk9\", \"content\": [{\"text\": \"Hello! How can I help you today?\", \"type\": \"text\"}], \"model\": \"claude-3-5-sonnet-20241022\", \"role\": \"assistant\", \"stop_reason\": \"end_turn\", \"stop_sequence\": null, \"type\": \"message\", \"usage\": {\"input_tokens\": 8, \"output_tokens\": 12}}",
    "conversation_id": "01jatgr9hv698yyfx7yq625exp",
    "duration_ms": 716,
    "datetime_utc": "2024-10-22T16:25:24.589758"
  }
]
simonw commented 1 month ago

Confirmation that claude-3.5-sonnet-latest already points to the new model:

llm -m claude-3.5-sonnet 'short poem about a bear'

Here's a short poem about a bear:

Fuzzy brown bear with powerful might, Wandering through forests day and night. Fishing for salmon in crystal streams, Honey for snacks, or so it seems. With mighty paws and sleepy eyes, Under starlit mountain skies.

sqlite-utils "$(llm logs path)" \
  'select * from responses order by id desc limit 1' \
  | jq '.[0].response_json' -r | jq
{
  "id": "msg_018X7LJn8TJ9oJH4R7kLftXC",
  "content": [
    {
      "text": "Here's a short poem about a bear:\n\nFuzzy brown bear with powerful might,\nWandering through forests day and night.\nFishing for salmon in crystal streams,\nHoney for snacks, or so it seems.\nWith mighty paws and sleepy eyes,\nUnder starlit mountain skies.",
      "type": "text"
    }
  ],
  "model": "claude-3-5-sonnet-20241022",
  "role": "assistant",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "type": "message",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 71
  }
}