Skip to content

Commit

Permalink
Always use the latest versions of Anthropic's 3.5 models
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-si committed Dec 7, 2024
1 parent d213c4d commit fa0f78c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
36 changes: 19 additions & 17 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,28 @@ const OPENAI_MODEL_MAPPING_SRC: [(&str, &str); 13] = [
("t35", "gpt-3.5-turbo"),
];

const ANTHROPIC_MODEL_MAPPING_SRC: [(&str, &str); 20] = [
const ANTHROPIC_MODEL_MAPPING_SRC: [(&str, &str); 22] = [
// Default models
("claude-opus", "claude-3-opus-20240229"),
("opus", "claude-3-opus-20240229"),
("op", "claude-3-opus-20240229"),
("o", "claude-3-opus-20240229"),
("claude-sonnet", "claude-3-5-sonnet-20240620"),
("sonnet", "claude-3-5-sonnet-20240620"),
("so", "claude-3-5-sonnet-20240620"),
("s", "claude-3-5-sonnet-20240620"),
("claude-haiku", "claude-3-haiku-20240307"),
("haiku", "claude-3-haiku-20240307"),
("ha", "claude-3-haiku-20240307"),
("h", "claude-3-haiku-20240307"),
("claude-opus", "claude-3-opus-latest"),
("opus", "claude-3-opus-latest"),
("op", "claude-3-opus-latest"),
("o", "claude-3-opus-latest"),
("claude-sonnet", "claude-3-5-sonnet-latest"),
("sonnet", "claude-3-5-sonnet-latest"),
("so", "claude-3-5-sonnet-latest"),
("s", "claude-3-5-sonnet-latest"),
("claude-haiku", "claude-3-5-haiku-latest"),
("haiku", "claude-3-5-haiku-latest"),
("ha", "claude-3-5-haiku-latest"),
("h", "claude-3-5-haiku-latest"),
// Version 3.5 models
("claude-sonnet-3-5", "claude-3-5-sonnet-20240620"),
("sonnet-3-5", "claude-3-5-sonnet-20240620"),
("claude-sonnet-3-5", "claude-3-5-sonnet-latest"),
("sonnet-3-5", "claude-3-5-sonnet-latest"),
("claude-haiku-3-5", "claude-3-5-haiku-latest"),
("haiku-3-5", "claude-3-5-haiku-latest"),
// Version 3 models
("claude-opus-3", "claude-3-opus-20240229"),
("opus-3", "claude-3-opus-20240229"),
("claude-opus-3", "claude-3-opus-latest"),
("opus-3", "claude-3-opus-latest"),
("claude-sonnet-3", "claude-3-sonnet-20240229"),
("sonnet-3", "claude-3-sonnet-20240229"),
("claude-haiku-3", "claude-3-haiku-20240307"),
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Examples:
cai anthropic claude-opus Which year did the Titanic sink
cai an claude-opus Which year did the Titanic sink
cai cl Which year did the Titanic sink
cai anthropic claude-3-opus-20240229 Which year did the Titanic sink
cai anthropic claude-3-opus-latest Which year did the Titanic sink
# Send a prompt to locally running Ollama server
cai ollama llama3 Which year did the Titanic sink
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ for all supported model ids):"
<b>cai anthropic claude-opus</b> Which year did the Titanic sink
<b>cai an claude-opus</b> Which year did the Titanic sink
<b>cai cl</b> Which year did the Titanic sink
<b>cai anthropic claude-3-opus-20240229</b> Which year did the Titanic sink
<b>cai anthropic claude-3-opus-latest</b> Which year did the Titanic sink
<dim># Send a prompt to locally running Ollama server</dim>
<b>cai ollama llama3</b> Which year did the Titanic sink
Expand Down Expand Up @@ -276,7 +276,7 @@ async fn exec_with_args(args: Args, stdin: &str) {
submit_prompt(
&Some(&Model::Model(
Provider::Anthropic,
"claude-3-opus-20240229".to_string(),
"claude-3-opus-latest".to_string(),
)),
&opts,
&format!("{stdin}{}", prompt.join(" ")),
Expand All @@ -287,7 +287,7 @@ async fn exec_with_args(args: Args, stdin: &str) {
submit_prompt(
&Some(&Model::Model(
Provider::Anthropic,
"claude-3-5-sonnet-20240620".to_string(),
"claude-3-5-sonnet-latest".to_string(),
)),
&opts,
&format!("{stdin}{}", prompt.join(" ")),
Expand All @@ -298,7 +298,7 @@ async fn exec_with_args(args: Args, stdin: &str) {
submit_prompt(
&Some(&Model::Model(
Provider::Anthropic,
"claude-3-haiku-20240307".to_string(),
"claude-3-5-haiku-latest".to_string(),
)),
&opts,
&format!("{stdin}{}", prompt.join(" ")),
Expand All @@ -325,7 +325,7 @@ async fn exec_with_args(args: Args, stdin: &str) {
let models = vec![
Model::Model(
Provider::Anthropic,
"claude-3-5-sonnet-20240620".to_string(),
"claude-3-5-sonnet-latest".to_string(),
),
Model::Model(Provider::Groq, "llama-3.1-8b-instant".to_string()),
Model::Model(Provider::OpenAI, "gpt-4o-mini".to_string()),
Expand Down

0 comments on commit fa0f78c

Please sign in to comment.