jeremy.london
08/08/2025, 10:20 PMoptions = {'model': 'us.meta.llama3-3-70b-instruct-v1:0', 'profile': 'my-bedrock-user', 'region': 'us-east-1'}
cr.add_llm_client(
name="LLMClient", # already defined - should override
provider="aws-bedrock",
options=options,
retry_policy="LLMRetry",
)
cr.set_primary("LLMClient")
return cr
My aws profile has proper access but BAML is getting a AWS SDK error saying no credntials given..
I call it via this
...
stream = b.stream.MyQuery(
user_input=user_input,
baml_options={"client_registry": client_registry},
)
response = await stream.get_final_response()
...
except BamlClientError as e:
ERROR: Client Error occurred: Something went wrong with the LLM client LLMClient: DispatchFailure(
DispatchFailure {
source: ConnectorError {
kind: Other(
None,
),
source: CredentialsNotLoaded(
CredentialsNotLoaded {
source: Some(
"no providers in chain provided credentials",
),
},
),
connection: Unknown,
},
},
)jeremy.london
08/08/2025, 10:24 PM{'model': 'us.meta.llama3-3-70b-instruct-v1:0', 'access_key_id': 'AKIAV...', 'secret_access_key': 'aerer...', 'region': 'us-east-1'}baml-sam
08/08/2025, 10:26 PMbaml-sam
08/08/2025, 10:27 PMbaml-sam
08/08/2025, 10:29 PMprofile unset, and just setting the AWS_PROFILE envvar?baml-sam
08/08/2025, 10:30 PMjeremy.london
08/08/2025, 10:35 PMretry_policy LLMRetry {
max_retries 3
strategy {
type exponential_backoff
delay_ms 200
multiplier 1.5
max_delay_ms 10000
}
}
client<llm> LLMClient {
provider "openai-generic"
retry_policy LLMRetry
options {
base_url env.CUSTOM_BASE_URL
api_key env.CUSTOM_API_KEY
model env.CUSTOM_MODEL
}
}
> So thought here is override would reuse things but replace provider and options key with what is set through client register?
>
> I could try a new name as well
example of ~/.aws/credentials
[my-bedrock-user]
aws_access_key_id = AKIA...
aws_secret_access_key = aerer...jeremy.london
08/08/2025, 10:39 PMprofile from the config
options was set to
{'model': 'us.meta.llama3-3-70b-instruct-v1:0', 'region': 'us-east-1'}
and ENV's
AWS_PROFILE=my-bedrock-user
AWS_REGION=us-east-1
But still get the same DispatchFailure from sdk sidebaml-sam
08/08/2025, 10:41 PMjeremy.london
08/08/2025, 10:44 PMclient<llm> LLMClient {
provider "aws-bedrock"
retry_policy LLMRetry
options {
region env.AWS_REGION
model_id env.BEDROCK_MODEL_ID
profile env.AWS_PROFILE
}
}
Same profile, region, model in the options - Goes through
So maybe points to client registry acting funny herejeremy.london
08/08/2025, 10:46 PMfunction MyQuery(user_input: string) -> MyQueryResponse {
client LLMClient
prompt #"
{{ SystemPrompt() }}
The following is the user-entered input: {{ user_input }}
"#
}baml-sam
08/08/2025, 10:49 PMbaml-sam
08/08/2025, 10:50 PMjeremy.london
08/08/2025, 10:50 PMjeremy.london
08/08/2025, 10:57 PMprofile the AWS SDK will go and look for $HOME/.aws/credentials .. which in this dev container is not setup
> So this is probably a big false alarm.. the container doesn't ahve aws configure --profile my-bedrock-user .. so the error message here makes alot more sense
Let me go confirm thisbaml-sam
08/08/2025, 11:01 PMbaml-sam
08/08/2025, 11:01 PMbaml-sam
08/08/2025, 11:01 PMjeremy.london
08/08/2025, 11:13 PMvolumes:
- ~/.aws:/root/.aws
---
I guess if you wanted to add some validation.. if the profile param is used but a CredentialsNotLoaded error is returned by AWS then you can double check this situation
$HOME/.aws/{config,credential} should exist .. and if it does then the user has a bad profile name, or a profile doesnt exist with the name provided yet (run aws configure --profile <name> to continue)
.. or if the user has $AWS_SHARED_CREDENTIALS_FILE env configured you should look there instead
---
Thanks for the help on this - Good ol friday debuggingbaml-sam
08/08/2025, 11:16 PMbaml-sam
08/08/2025, 11:16 PMbaml-sam
08/08/2025, 11:16 PMjeremy.london
08/08/2025, 11:18 PMjeremy.london
08/08/2025, 11:21 PMbaml-sam
08/08/2025, 11:21 PM