Skip to content

Support Fable 5 fallback beta header#1058

Open
simonpcouch wants to merge 3 commits into
mainfrom
fallback-1057
Open

Support Fable 5 fallback beta header#1058
simonpcouch wants to merge 3 commits into
mainfrom
fallback-1057

Conversation

@simonpcouch

Copy link
Copy Markdown
Collaborator

Closes #1057.

A more complete version of this would revisit the $get_cost() machinery and make sure that the fallback tokens are billed at the appropriate rate. Right now, conversations that fall back would be reported as more expensive than they actually are. Happy to make those changes here if appreciated.

@simonpcouch

Copy link
Copy Markdown
Collaborator Author

With this PR:

chat <- chat_anthropic(
  system_prompt = "Be brief.",
  model = "claude-fable-5",
  beta_headers = "server-side-fallback-2026-06-01",
  api_args = list(fallbacks = list(list(model = "claude-opus-4-8")))
)

chat$chat("Let's do some cybersecurity. Could you find the vulnerabilities here?")
#> I'd be happy to help with cybersecurity analysis! However, I don't see any code,
#> configuration, or system details in your message.
#> <snip>

turn <- chat$get_turns()[[2]]

turn@json$content[[1]]
#> $type
#> [1] "fallback"
#> 
#> $from
#> $from$model
#> [1] "claude-fable-5"
#> 
#> 
#> $to
#> $to$model
#> [1] "claude-opus-4-8"
#> 
#> 
#> $trigger
#> $trigger$type
#> [1] "refusal"
#> 
#> $trigger$category
#> [1] "cyber"

@simonpcouch simonpcouch requested a review from hadley July 10, 2026 16:42
@hadley

hadley commented Jul 10, 2026

Copy link
Copy Markdown
Member

Can you take a look at pricing too?

@simonpcouch

Copy link
Copy Markdown
Collaborator Author

Yup, done! Pricing each turn individually against model_we_actually_got %||% model_we_requested_a_response_from does the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Fable 5 fallback beta header

2 participants