@@ -27,6 +27,7 @@ import (
2727
2828 "charm.land/fantasy/providers/anthropic"
2929 "charm.land/fantasy/providers/azure"
30+ "charm.land/fantasy/providers/bedrock"
3031 "charm.land/fantasy/providers/google"
3132 "charm.land/fantasy/providers/openai"
3233 "charm.land/fantasy/providers/openaicompat"
@@ -401,11 +402,23 @@ func (c *coordinator) buildAgentModels(ctx context.Context) (Model, Model, error
401402 return Model{}, Model{}, errors.New("snall model not found in provider config")
402403 }
403404
404− largeModel, err := largeProvider.LanguageModel(ctx, largeModelCfg.Model)
405+ largeModelID := largeModelCfg.Model
406+ smallModelID := smallModelCfg.Model
407+
408+ // FIXME(@andreynering): Temporary fix to get it working.
409+ // We need to prefix the model with with `{region}.`
410+ if largeModelCfg.Provider == bedrock.Name {
411+ largeModelID = fmt.Sprintf("us.%s", largeModelID)
412+ }
413+ if smallModelCfg.Provider == bedrock.Name {
414+ smallModelID = fmt.Sprintf("us.%s", smallModelID)
415+ }
416+
417+ largeModel, err := largeProvider.LanguageModel(ctx, largeModelID)
405418 if err != nil {
406419 return Model{}, Model{}, err
407420 }
408− smallModel, err := smallProvider.LanguageModel(ctx, smallModelCfg.Model)
421+ smallModel, err := smallProvider.LanguageModel(ctx, smallModelID)
409422 if err != nil {
410423 return Model{}, Model{}, err
411424 }
@@ -526,6 +539,18 @@ func (c *coordinator) buildAzureProvider(baseURL, apiKey string, headers map[str
526539 return azure.New(opts...)
527540}
528541
542+func (c *coordinator) buildBedrockProvider(headers map[string]string) (fantasy.Provider, error) {
543+ var opts []bedrock.Option
544+ if c.cfg.Options.Debug {
545+ httpClient := log.NewHTTPClient()
546+ opts = append(opts, bedrock.WithHTTPClient(httpClient))
547+ }
548+ if len(headers) > 0 {
549+ opts = append(opts, bedrock.WithHeaders(headers))
550+ }
551+ return bedrock.New(opts...)
552+}
553+
529554func (c *coordinator) buildGoogleProvider(baseURL, apiKey string, headers map[string]string) (fantasy.Provider, error) {
530555 opts := []google.Option{
531556 google.WithBaseURL(baseURL),
@@ -599,6 +624,8 @@ func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model con
599624 return c.buildOpenrouterProvider(baseURL, apiKey, headers)
600625 case azure.Name:
601626 return c.buildAzureProvider(baseURL, apiKey, headers, providerCfg.ExtraParams)
627+ case bedrock.Name:
628+ return c.buildBedrockProvider(headers)
602629 case google.Name:
603630 return c.buildGoogleProvider(baseURL, apiKey, headers)
604631 case "google-vertex", "vertexai":