* Add retries to bedrock createMessage
Add retries to Bedrock's createMessage as indicated by [this](https://github.com/cline/cline/pull/1605#issuecomment-2665904349)
Similar to [this comment](https://github.com/cline/cline/pull/1605#issuecomment-2666290702) I am also experiencing a 429 every once in a while. Measuring a before/after, it's about a 90% improvement when there's no prompt caching. I'm going to add some logging and see if I can track it down further but honestly this is probably worth it as is.
* Add changeset
* Add Bedrock prompt caching support (optional)
This feature protected under checkbox because it is not yet rolled out
to everyone, and if you will try to send cache headers, and its not
enabled for you, you will get error
* Add changeset
* Update supported models
* Fix copy
---------
Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
* Extract reuseable ModelDescriptionMarkdown from OpenRouter model picker
* Requesty: Add model picker component
* Refactor readOpenRouterModels to allow any dynamic list filename
* Extract parsePrice to allow reuse by other providers
* Simplify model display name switch case
* Requesty: Add dynamic model list fetching from API
* Requesty: Add default model selection
* Requesty: Specify max_tokens when sending request
* Add changeset
---------
Co-authored-by: Dennis Bartlett <bartlett.dc.1@gmail.com>
* Add OpenAI compatible cost calculation
* Requesty: Prepare for correct price calculation
* Native OpenAI: Update model caching info
According to [OpenAI's
website](https://platform.openai.com/docs/guides/prompt-caching),
gpt-4o, gpt-4o-mini, o1-preview and o1-mini support caching.
For gpt-4o, even though gpt-4o-2024-05-13 and
chatgpt-4o-latest do no support caching, users will see there are no
cached tokens, which will help avoid confusion.
* Native OpenAI: Call getModel once
* Native OpenAI: Extract yield usage into method
* Native OpenAI: Add caching and cost info to task header
* DeepSeek: Add cost info to task header
* Add changeset
* feat(vertex): Add prompt caching support for Claude on Vertex AI
* Remove countTokens update claude 3.7
* claude-3-7-sonnet@20250219 support in Vertex AI as default model
Anthropic's Bedrock SDK creates an AWS credential provider chain [1]
for each request it needs to sign. By doing so right before actually
having to sign the request, it can utilize any session created after
VSCode launched (i.e. outside of the process), and it can renew the
sessions every time necessary transparently for the user.
Cline, on the other hand, by transforming the provided AWS_PROFILE into
a key / secret / session, as part of client initialization, completely
short-circuits this, making it very difficult for users in companies where
sessions are short-lived. Furthermore, Cline would silently ignore the
provided AWS_PROFILE if there isn't a current/non-expired session at the time
of initialization, pass null keys to the Bedrock SDK, which would then
make use the default profile, which may not be configured or authorized
to use AWS Bedrock (as most AWS SSO hub accounts would). From the
perspective of the user, this would manifest itself as an "supported
country" error or unhelpful errors that are basically impossible to
debug without attaching a debugger to Cline.. and such developers may
end up reaching out to their DevOps/IT teams for help, which also could
turn into a waste of time.
This PR addresses the aforementioned issues by resolving the credentials on
every invocation.
1: 61b55599d5/packages/bedrock-sdk/src/auth.ts (L19)