boto3 “Unknown Service: bedrock-runtime” and “Unknown Parameter”: Update the SDK That Actually Runs
“Unknown service: 'bedrock-runtime'” means the boto3 your code is running is too old to know about Amazon Bedrock.
The surprise: pip install --upgrade boto3 can succeed and still leave you stuck. Current boto3 needs Python 3.10 or newer, so on an older Python pip quietly stops at an old release.
Jake’s Lambda function called Bedrock fine on the developer’s laptop. Deployed to AWS, it failed on its first line with this error.
Jake: "It works on my machine. Why not in Lambda?"
Ethan: "Because Lambda isn’t using the boto3 on your machine. It uses its own, and that one may be older."
Why an old boto3 breaks Bedrock calls
boto3 doesn’t ask AWS which services exist. Each release carries a built-in description of every service and parameter, inside botocore. A release from before Bedrock doesn’t know bedrock-runtime; a release from before a Bedrock feature doesn’t know that feature’s operation or parameters. Your request never leaves the machine. Same cause, different messages:
| Error | What the old SDK is missing |
|---|---|
UnknownServiceError: Unknown service: 'bedrock-runtime' | Bedrock itself (boto3 older than 1.28.57, September 2023) |
Unknown service: 'bedrock-agent-runtime' | Agents and knowledge bases |
ParamValidationError: Unknown parameter in input | A parameter added later, such as newer retrieve_and_generate options |
'BedrockRuntime' object has no attribute 'converse' | The Converse API (mid-2024) |
aws: error: argument command: Invalid choice | An AWS CLI older than the service |
Step 1: check the version your code actually runs
Put this at the top of the failing program, in the same place it fails (script, notebook cell, Lambda handler, container):
import sys, platform, boto3, botocore
print("python ", platform.python_version(), sys.executable)
print("boto3 ", boto3.__version__)
print("botocore", botocore.__version__)
Compare with the latest on PyPI (1.44.15 on November 30, 2026). The sys.executable line catches the most common trap: you upgraded one Python and the code runs on another.
Jake: "My laptop says 1.44. The function says 1.34. Same code?"
Ethan: "Same code, different Python. Now we know which one to fix."
Step 2: upgrade on your own machine
python -m pip install --upgrade boto3 botocore # same python that runs your code
python -c "import boto3; print(boto3.__version__)"
- Use
python -m pip, not a barepipthat may belong to another Python. - Inside a virtual environment, activate it first.
- In Jupyter, run
%pip install -U boto3 botocoreand restart the kernel; a running kernel keeps the old module loaded. - If pip installs an old version anyway, check your Python: current boto3 needs 3.10 or newer.
Step 3: fix it in AWS Lambda
Lambda’s Python runtimes include a boto3, but its version depends on the runtime and the Region (see the Lambda Python runtime page), so you don’t control it. Two dependable fixes:
Bundle boto3 with the function. Install it into your deployment package next to your code:
pip install --upgrade boto3 botocore -t package/
cp lambda_function.py package/
cd package && zip -r ../function.zip . && cd ..
aws lambda update-function-code --function-name parts-bot --zip-file fileb://function.zip
Or use a layer, shared by several functions (Python layers):
pip install --upgrade boto3 botocore -t python/
zip -r boto3-layer.zip python
aws lambda publish-layer-version --layer-name boto3-latest \
--zip-file fileb://boto3-layer.zip --compatible-runtimes python3.13 python3.14
Then attach the layer and print the version from the handler once to confirm. Moving an old function to a current runtime (python3.13 or later, on Amazon Linux 2023) helps too, but bundling is what guarantees the version.
Step 4: fix it in Docker
A container keeps the boto3 it was built with. Upgrading inside a running container doesn’t change the image, so the next start brings the old version back. Pin a minimum in requirements.txt and rebuild:
# requirements.txt
boto3>=1.44
docker build --no-cache -t parts-bot .
docker run --rm parts-bot python -c "import boto3; print(boto3.__version__)"
Step 5: use the right client
Once the SDK is current, a wrong client name gives similar-looking errors. Bedrock has four:
| Client | Use it for | Example calls |
|---|---|---|
bedrock | Managing models and settings | list_foundation_models, get_foundation_model |
bedrock-runtime | Running models | converse, invoke_model, streaming versions |
bedrock-agent | Building agents and knowledge bases | create_agent, start_ingestion_job |
bedrock-agent-runtime | Calling agents and knowledge bases | invoke_agent, retrieve_and_generate |
Calling invoke_model on a bedrock client fails with an attribute error. The bedrock-runtime reference lists every runtime call; for the client basics see boto3 session vs client.
Keep it from coming back
- Pin a minimum boto3 version in every requirements file that touches Bedrock.
- Bundle boto3 in Lambda functions instead of relying on the runtime’s copy.
- Rebuild container images on a schedule so the SDK doesn’t drift for months.
- Log the boto3 version at start-up in services that call new Bedrock features.
Once the SDK knows the call, the next errors are about the request itself: malformed input or model ID.
Jake’s fix
- Printed versions in the handler: boto3 from the runtime, older than the Converse call the code used.
- Built a layer with the latest boto3 and botocore, attached it.
- Pinned
boto3>=1.44in requirements.txt for the container version of the bot. - Redeployed: the function answered on the first call.
Jake: "So I check the version where the code runs, every time?"
For readers preparing for an AWS certification
We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.
Exams that test this topic: Developer – Associate (DVA-C03 from December 1, 2026) • Machine Learning Engineer – Associate (MLA-C02) • Solutions Architect – Associate (SAA-C03).
Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:
1. A Python Lambda function that calls bedrock-runtime fails with "Unknown service: 'bedrock-runtime'" although it works locally. What is the most reliable fix?
Bundle a current boto3 and botocore with the function (in the deployment package or a Lambda layer). The SDK included in the Lambda runtime varies by runtime and Region and may be older than the code needs.
2. After a developer upgrades boto3, a call to retrieve_and_generate still fails with ParamValidationError: Unknown parameter in input. Why?
The code still runs an older botocore, which validates parameters against its own copy of the API before sending the request. Upgrade boto3 and botocore in the environment that actually runs the code and confirm with botocore.__version__.
3. Which boto3 client should an application use to call a Bedrock knowledge base with retrieve_and_generate?
bedrock-agent-runtime. The bedrock-agent client creates and manages agents and knowledge bases; bedrock-runtime runs models; bedrock manages model settings.
4. A container image built months ago fails on client.converse with an attribute error. What should the team do?
Pin a minimum boto3 version in requirements and rebuild the image; upgrading inside a running container does not change the image.
5. Why might pip install --upgrade boto3 leave an outdated boto3 on a server?
Current boto3 releases require Python 3.10 or newer; on an older Python, pip installs the newest release that still supports it, which may lack newer Bedrock features.
Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.
Ethan: "Every time. Your laptop’s boto3 has never been the one in production."
Official references for this guide
- Lambda Python runtimes: supported runtimes and how the included SDK version varies by runtime and Region.
- Working with layers for Python: packaging dependencies such as boto3.
- boto3 bedrock-runtime reference and boto3 on PyPI (Python requirement and releases).
Frequently asked questions
What does "Unknown service: 'bedrock-runtime'" mean?
The boto3 and botocore installed where your code runs are older than Amazon Bedrock, so they don’t know the bedrock-runtime service. Upgrade both in that exact environment: your virtual environment, Lambda package or Docker image.
Which boto3 version supports Bedrock?
Bedrock arrived in boto3 1.28.57, released September 28, 2023. Newer Bedrock features need newer releases; for example, the Converse API needs a boto3 from mid-2024 or later. Use the latest release when you can.
I upgraded boto3 but still get Unknown service. Why?
Usually the upgrade went to a different Python than the one running your code, or your Python is too old for current boto3. Run python -m pip install -U boto3 botocore with the same interpreter, and print boto3.__version__ from your program.
Why does pip install --upgrade boto3 install an old version?
Current boto3 needs Python 3.10 or newer. On an older Python, pip picks the newest release that still supports it, which may predate the Bedrock feature you need. Upgrade Python first.
How do I fix Unknown service bedrock-runtime in AWS Lambda?
Lambda’s built-in boto3 depends on the runtime and Region. Package your own boto3 with the function or in a layer, or move to a newer Python runtime, then print boto3.__version__ in the function to confirm.
How do I fix "Unknown parameter in input" for Bedrock?
botocore checks parameters against its own copy of the API. A parameter added after your botocore was released, such as newer retrieve_and_generate options, is rejected before the request is sent. Upgrade boto3 and botocore.
Why does boto3 say 'BedrockRuntime' object has no attribute 'converse'?
Your boto3 predates the Converse API. Upgrade boto3 and botocore; Converse arrived in mid-2024.
What is the difference between the bedrock and bedrock-runtime clients?
bedrock manages models and account settings, such as list_foundation_models. bedrock-runtime runs inference: invoke_model, converse and their streaming versions.
Which client do Bedrock agents and knowledge bases use?
bedrock-agent builds and manages agents and knowledge bases; bedrock-agent-runtime calls them, with invoke_agent, retrieve and retrieve_and_generate.
Does a Docker image update boto3 automatically?
No. An image keeps the boto3 it was built with. Pin a minimum version in requirements.txt and rebuild the image, without the build cache if needed.
How do I check the boto3 version inside a container or Lambda?
Print boto3.__version__ and botocore.__version__ from the running code, along with sys.executable for the Python in use. Checking on your laptop tells you nothing about the container.
Do I need to upgrade botocore as well as boto3?
Yes. The service definitions live in botocore; boto3 depends on it. Upgrade both together, or let pip upgrade botocore by upgrading boto3.
Can an old AWS CLI give a similar error?
Yes. An AWS CLI version that predates Bedrock rejects bedrock-runtime as an invalid command choice. Update the CLI; AWS CLI v2 bundles its own botocore, separate from your Python boto3.
Which Python runtime should I use in Lambda for Bedrock?
A current one, such as python3.13 or python3.14 on Amazon Linux 2023, and still bundle a recent boto3 with the function so you control the SDK version.
Why does my Jupyter notebook still use the old boto3?
The notebook kernel loaded boto3 before you upgraded. Restart the kernel after upgrading, and install with %pip install -U boto3 botocore so it goes into the kernel’s environment.
Is "Unknown service" a permissions or Region problem?
No. It happens on your machine before any request is sent. Permissions give AccessDeniedException and Region problems give model errors.
Revision note. Written November 30, 2026, against the Lambda Python runtime documentation and boto3 1.44.15. “Out of sight, out of mind”: the SDK inside your function is the one you never see, so print it.