Using vLLM's Qwen and Amazon Bedrock through Amazon Bedrock AgentCore Gateway
Fusic engineer Leona runs a quantized Qwen3.6 with vLLM[1] on rented RunPod GPUs, only during weekday daytime. When no GPU is available, the author wanted Amazon Bedrock models to answer instead. Using the inference target of Amazon Bedrock AgentCore Gateway, the author made both vLLM and Amazon Bedrock callable from one OpenAI-compatible[2] API, with OpenCode as the client.
The gateway routes each request by the model name. The provider format lists accepted model names and allows wildcards, while the connector format points to built-in endpoints such as bedrock-mantle. The API key for vLLM is kept in the token vault[3] of AgentCore Identity and attached by the gateway. Because the Terraform resource for the gateway target had no inference block, the target was created with AWS CloudFormation.
An interceptor[4] Lambda function runs before each request is sent to the target. When vLLM is down, it rewrites the model name to an Amazon Bedrock model and records each call with the user identified from the Cognito JWT. In the tests, model-name routing worked and the Cognito access token was accepted, while the ID token got a 403. Claude on Amazon Bedrock worked in the Messages format but returned a 400 with Chat Completions. The interceptor took 1.7 to 2.7 ms.
Sources
-
JPZenn JA
Amazon Bedrock AgentCore Gatewayで、vLLMのQwenとAmazon Bedrockを使い分けてみた





