Can't seem to use Llama 4 maverick on bedrock wants an ARN #1712

Closed
opened 2026-02-16 17:32:17 -05:00 by yindo · 14 comments
Owner

Originally created by @jrgleason on GitHub (Sep 14, 2025).

Originally assigned to: @thdxr on GitHub.

I am trying to use Opencode with Llama 4 maverick. I sso in using the profile and set the env vars

 > export AWS_PROFILE=default 
 > export AWS_REGION=us-east-2

And I have confirmed it is approved

Image

But I get

Error: AI_APICallError: undefined: Invocation of model ID meta.llama4-maverick-17b-instruct-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model.

I have the cross-region reference I could use but I am not sure how to set that properly and there isn't much documentation.

Originally created by @jrgleason on GitHub (Sep 14, 2025). Originally assigned to: @thdxr on GitHub. I am trying to use Opencode with Llama 4 maverick. I sso in using the profile and set the env vars ``` > export AWS_PROFILE=default > export AWS_REGION=us-east-2 ``` And I have confirmed it is approved <img width="1089" height="43" alt="Image" src="https://github.com/user-attachments/assets/f356e599-1c72-4bfb-8bb4-cee014049046" /> But I get ``` Error: AI_APICallError: undefined: Invocation of model ID meta.llama4-maverick-17b-instruct-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model. ``` I have the cross-region reference I could use but I am not sure how to set that properly and there isn't much documentation.
yindo closed this issue 2026-02-16 17:32:17 -05:00
Author
Owner

@jrgleason commented on GitHub (Sep 14, 2025):

I am ssoed and I did try a non-default profile.

@jrgleason commented on GitHub (Sep 14, 2025): I am ssoed and I did try a non-default profile.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 14, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #136: cannot call bedrock models with cross-region profile (discusses the same 'ARN of an inference profile' error and cross-region inference setup)
  • #243: Error trying to use Claude on AWS Bedrock (same error message about inference profile ARN requirement)
  • #396: Bedrock not working in 0.1.136 (identical error message about inference profile ARN)

These issues address the same AWS Bedrock inference profile configuration problem you're experiencing with Llama 4 maverick. The solution typically involves configuring cross-region inference profiles with the proper ARN or region prefix.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 14, 2025): This issue might be a duplicate of existing issues. Please check: - #136: cannot call bedrock models with cross-region profile (discusses the same 'ARN of an inference profile' error and cross-region inference setup) - #243: Error trying to use Claude on AWS Bedrock (same error message about inference profile ARN requirement) - #396: Bedrock not working in 0.1.136 (identical error message about inference profile ARN) These issues address the same AWS Bedrock inference profile configuration problem you're experiencing with Llama 4 maverick. The solution typically involves configuring cross-region inference profiles with the proper ARN or region prefix. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 14, 2025):

I haven't played with bedrock yet, if I get the chance I will try to spin it up

@rekram1-node commented on GitHub (Sep 14, 2025): I haven't played with bedrock yet, if I get the chance I will try to spin it up
Author
Owner

@OpeOginni commented on GitHub (Sep 16, 2025):

Hey @jrgleason could you take a look at this and try? https://repost.aws/questions/QUEU82wbYVQk2oU4eNwyiong/bedrock-api-invocation-error-on-demand-throughput-isn-s-supported#ANNQqbEWUFTNSigrdsJlfx1w

So rather than use the name meta.llama4-maverick-17b-instruct-v1:0 search for the ARN and use that, the link shows where you can find the profiles and the ARNs.

@OpeOginni commented on GitHub (Sep 16, 2025): Hey @jrgleason could you take a look at this and try? https://repost.aws/questions/QUEU82wbYVQk2oU4eNwyiong/bedrock-api-invocation-error-on-demand-throughput-isn-s-supported#ANNQqbEWUFTNSigrdsJlfx1w So rather than use the name `meta.llama4-maverick-17b-instruct-v1:0` search for the ARN and use that, the link shows where you can find the profiles and the ARNs.
Author
Owner

@jrgleason commented on GitHub (Sep 16, 2025):

Hey @jrgleason could you take a look at this and try? https://repost.aws/questions/QUEU82wbYVQk2oU4eNwyiong/bedrock-api-invocation-error-on-demand-throughput-isn-s-supported#ANNQqbEWUFTNSigrdsJlfx1w

So rather than use the name meta.llama4-maverick-17b-instruct-v1:0 search for the ARN and use that, the link shows where you can find the profiles and the ARNs.

So I have tried with the arn like this

{
  "$schema": "https://opencode.ai/config.json",
  "model": "arn:aws:bedrock:us-east-2:....:inference-profile/us.meta.llama4-maverick-17b-instruct-v1:0"
}

This is in ~/opencode/opencode.json and then I restart opencode but I am still getting

AI_APICallError: undefined: Invocation of model ID meta.llama4-maverick-17b-instruct-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an
inference profile that contains this model.

Is my configuration correct? Claude code works fine with something similar. I am using AWS SSO and I made sure it was connected. I am also using us-east-2. Let me know if there are any flags in that.

@jrgleason commented on GitHub (Sep 16, 2025): > Hey [@jrgleason](https://github.com/jrgleason) could you take a look at this and try? https://repost.aws/questions/QUEU82wbYVQk2oU4eNwyiong/bedrock-api-invocation-error-on-demand-throughput-isn-s-supported#ANNQqbEWUFTNSigrdsJlfx1w > > So rather than use the name `meta.llama4-maverick-17b-instruct-v1:0` search for the ARN and use that, the link shows where you can find the profiles and the ARNs. So I have tried with the arn like this ``` { "$schema": "https://opencode.ai/config.json", "model": "arn:aws:bedrock:us-east-2:....:inference-profile/us.meta.llama4-maverick-17b-instruct-v1:0" } ``` This is in `~/opencode/opencode.json` and then I restart opencode but I am still getting ``` AI_APICallError: undefined: Invocation of model ID meta.llama4-maverick-17b-instruct-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model. ``` Is my configuration correct? Claude code works fine with something similar. I am using AWS SSO and I made sure it was connected. I am also using `us-east-2`. Let me know if there are any flags in that.
Author
Owner

@OpeOginni commented on GitHub (Sep 16, 2025):

Could you try one of these? @jrgleason

us.meta.llama4-maverick-17b-instruct-v1:0

us-east-2.meta.llama4-maverick-17b-instruct-v1:0

@OpeOginni commented on GitHub (Sep 16, 2025): Could you try one of these? @jrgleason `us.meta.llama4-maverick-17b-instruct-v1:0` `us-east-2.meta.llama4-maverick-17b-instruct-v1:0`
Author
Owner

@jrgleason commented on GitHub (Sep 16, 2025):

NM looks like it might be specific to LLama since Bedrock Claude is working on OpenCode. But I also see that it is ignoring the model in my opencode.json and I can only change it with /models which doesn't let me manually set. Is there another file on windows the cli might be writing to?

@jrgleason commented on GitHub (Sep 16, 2025): NM looks like it might be specific to LLama since Bedrock Claude is working on OpenCode. But I also see that it is ignoring the model in my `opencode.json` and I can only change it with `/models` which doesn't let me manually set. Is there another file on windows the cli might be writing to?
Author
Owner

@jrgleason commented on GitHub (Sep 16, 2025):

Also when I try to use deepseek I get

AI_APICallError: undefined: This model doesn't support tool use in streaming mode.
@jrgleason commented on GitHub (Sep 16, 2025): Also when I try to use deepseek I get ``` AI_APICallError: undefined: This model doesn't support tool use in streaming mode. ```
Author
Owner

@jrgleason commented on GitHub (Sep 16, 2025):

And I don't see any Mistral support through AWS

@jrgleason commented on GitHub (Sep 16, 2025): And I don't see any Mistral support through AWS
Author
Owner

@jrgleason commented on GitHub (Sep 16, 2025):

Nova Pro acts the same as Llama FTR

@jrgleason commented on GitHub (Sep 16, 2025): Nova Pro acts the same as Llama FTR
Author
Owner

@rekram1-node commented on GitHub (Sep 16, 2025):

This is in ~/opencode/opencode.json and then I restart opencode but I am still getting

Run opencode debug paths that will show you config directory that opencode.json should be in, shouldn't be ~/opencode/...

@rekram1-node commented on GitHub (Sep 16, 2025): > This is in ~/opencode/opencode.json and then I restart opencode but I am still getting Run `opencode debug paths` that will show you config directory that opencode.json should be in, shouldn't be `~/opencode/...`
Author
Owner

@kjenney commented on GitHub (Sep 27, 2025):

I'm getting the same issue with Nova Premier. Replacing the model with the inference ID or ARN does not resolve the issue and gives the same error. How do we get this to work?

@kjenney commented on GitHub (Sep 27, 2025): I'm getting the same issue with Nova Premier. Replacing the model with the inference ID or ARN does not resolve the issue and gives the same error. How do we get this to work?
Author
Owner

@rekram1-node commented on GitHub (Sep 27, 2025):

@kjenney I am going to get bedrock setup for myself so I can help u with this

@rekram1-node commented on GitHub (Sep 27, 2025): @kjenney I am going to get bedrock setup for myself so I can help u with this
Author
Owner

@R44VC0RP commented on GitHub (Jan 25, 2026):

Thanks for reporting this @jrgleason!

This issue affects Llama 4 (and other models) on AWS Bedrock that require cross-region inference profiles. While OpenCode auto-prefixes Claude and Nova models, Llama 4 currently requires manual configuration.

Workaround

Specify the prefixed model ID in your opencode.json:

{
  "provider": {
    "amazon-bedrock": {
      "models": {
        "us.meta.llama4-maverick-17b-instruct-v1:0": {
          "name": "Llama 4 Maverick"
        }
      },
      "options": {
        "region": "us-east-2"
      }
    }
  }
}

See #2746 for more detailed examples of configuring Bedrock inference profiles.

Closing as the workaround is available. If you run into further issues, feel free to reopen!

@R44VC0RP commented on GitHub (Jan 25, 2026): Thanks for reporting this @jrgleason! This issue affects Llama 4 (and other models) on AWS Bedrock that require cross-region inference profiles. While OpenCode auto-prefixes Claude and Nova models, Llama 4 currently requires manual configuration. ## Workaround Specify the prefixed model ID in your `opencode.json`: ```json { "provider": { "amazon-bedrock": { "models": { "us.meta.llama4-maverick-17b-instruct-v1:0": { "name": "Llama 4 Maverick" } }, "options": { "region": "us-east-2" } } } } ``` See #2746 for more detailed examples of configuring Bedrock inference profiles. Closing as the workaround is available. If you run into further issues, feel free to reopen!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1712