-
Notifications
You must be signed in to change notification settings - Fork 177
Question: Support for imported models? #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@thiagoscodelerae I've got a branch that supports custom models and an open PR. If you setup via my branch you'll be all set:
git clone -b imported-models https://github.com/sean-smith/bedrock-access-gateway
cd bedrock-access-gateway/
cd src/
docker buildx build --platform linux/amd64 -t bedrock-access-gateway .
![]()
aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <account-id>.dkr.ecr.<region>.amazonaws.com
docker tag bedrock-access-gateway:latest <account-id>.dkr.ecr.<region>.amazonaws.com/bedrock-access-gateway:latest
docker push <account-id>.dkr.ecr.<region>.amazonaws.com/bedrock-access-gateway:latest
aws cloudformation create-stack --stack-name bedrock-access-gateway --template-body file://deployment/BedrockProxy.yaml --parameter ParameterKey=ApiKeyParam,ParameterValue=BedrockProxyAPIKey ParameterKey=EnableImportedModels,ParameterValue=true ParameterKey=ImageUri,ParameterValue=<account-id>.dkr.ecr.<region>.amazonaws.com/bedrock-access-gateway:latest
--capabilities CAPABILITY_AUTO_EXPAND Now you can call your custom model and it'll show up when you list custom models: from openai import OpenAI
client = OpenAI()
# List available models
for model in client.models.list():
print(model.id)
# call custom model by arn
completion = client.chat.completions.create(
model="arn:aws:bedrock:us-west-2:<account-id>:imported-model/<model-id>",
messages=[
{
"role": "user",
"content": "Hello! please tell me a joke"
}
],
) Voila! See #97 for more details. |
@sean-smith thanks for sharing. The list models function is working fine but the custom call to the model is not working with the following error:
For now (local testing purposes before pushing to AWS), I'm using this fork below with a couple of changes. It is working fine so far. Changed this: to:
It might help you with your implementation. |
Does this solution support the use of imported models? For example, I'm importing
DeepSeek-R1-Distill-Llama-8B
The text was updated successfully, but these errors were encountered: