Cloud Platforms
Amazon SageMaker Model Serving
Call your own SageMaker real-time endpoint through Verdictan. The gateway signs each request with AWS credentials from its own environment, and your application only ever holds a Verdictan application token.
Your inference container must accept and return OpenAI-compatible JSON. Verdictan forwards the OpenAI body unchanged and does not adapt it to other model schemas.
Before you start
- A working gateway from the quickstart.
- A SageMaker real-time endpoint whose container reads and writes the OpenAI format.
- AWS credentials allowed to call
sagemaker:InvokeEndpointon that endpoint. - The gateway startup command, and a separate application token for test requests.
Configure the provider
model is the endpoint name. base_url is the SageMaker runtime host of the endpoint's region, with https://, and aws_region must name the same region.
pack:
name: sagemaker-integration
version: 1.0.0
enabled: true
policies:
chain:
- prompt-injection
providers:
targets:
- id: sagemaker-primary
provider: sagemaker
model: "replace-with-endpoint-name"
base_url: https://runtime.sagemaker.us-east-1.amazonaws.com
aws_region: us-east-1There is no secret_key_ref. The gateway signs each request with AWS Signature Version 4 on the gateway host. It does not use secret_key_ref or api_key_prefix for this provider. It gets AWS credentials in this order:
- The variables that the optional target fields
aws_access_key_envandaws_secret_key_envname. The optionalaws_session_token_envfield names a session token variable. Set the first two fields together. AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYfrom the gateway environment, withAWS_SESSION_TOKENwhen it is set.- If neither of the two variables is set, the AWS SDK default credential chain for
aws_region. This includes an instance role. Setaws_profileon the target to use a named profile.
When the target sets the credential fields, use names with the VERDICTAN_ prefix, such as VERDICTAN_SAGEMAKER_ACCESS_KEY_ID.
Start and verify
Use the Console procedure below or CLI 0.1.14 or later to deploy this endpoint configuration. Check In sync. Then send the non-streaming request to verify the endpoint and AWS credentials.
With the quickstart in Docker, follow the container steps instead of steps 1 to 3.
-
In the gateway terminal, set the AWS credentials (and
AWS_SESSION_TOKENfor temporary ones), then lint:export AWS_ACCESS_KEY_ID="replace-with-access-key-id" export AWS_SECRET_ACCESS_KEY="replace-with-secret-access-key" verdictan policy lint --file policy-config.yaml -
Restart the test gateway with the AWS credentials in its environment.
-
Deploy the file to the test agent in Configurations. If that agent already runs
pack.version1.0.0, increase the version first. Then wait for the gateway log lineconnected read model refresh applied updated configwith your version asconfig_version. Try the change on a test gateway has the steps. -
In another terminal, send a non-streaming request whose
modelis the endpoint name:export VERDICTAN_CLIENT_TOKEN="replace-with-different-client-token" curl --fail-with-body http://127.0.0.1:41002/v1/chat/completions \ -H "Authorization: Bearer ${VERDICTAN_CLIENT_TOKEN}" \ -H "Content-Type: application/json" \ -d '{"model":"replace-with-endpoint-name","stream":false,"messages":[{"role":"user","content":"Reply with Hello."}]}'
choices[0].message.content contains a reply. If it fails, tell AWS authorization errors apart from errors that the container returns.
Supported requests
| Request | Support |
|---|---|
| Chat Completions | Yes, sent to /endpoints/{endpoint-name}/invocations with the OpenAI body |
| Messages | Translated to Chat Completions |
| Embeddings | Yes, if the container accepts the embeddings schema. The policy chain does not run on embeddings. |
| Streaming | No. Keep stream: false. The SageMaker streaming API is not implemented. |
| Tool calls | Not verified |
| Responses, image input, structured output, parallel tool calls | No |
Failure behavior
| Situation | Result |
|---|---|
model or base_url is empty | Lint stops with an error naming the key. |
base_url is not https:// | The configuration is rejected. |
aws_region is empty | The gateway starts, but each request fails with sagemaker requires explicit aws_region in provider config. |
Only one of aws_access_key_env and aws_secret_key_env is set | The configuration is rejected. |
| A variable that a credential field names is not set | The gateway starts, but each request fails with which is not set or empty. |
Only one of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY is set | The gateway starts, but each request fails with found only one of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. |
| No AWS credentials are found | The gateway starts, but each request fails with AWS credential resolution failed. |
No sagemaker:InvokeEndpoint permission | SageMaker returns an authorization error, which the gateway passes on. |
The request model is not the endpoint name | The gateway does not select the target. |
SageMaker returns 4xx or 5xx | The gateway passes the status on. |
| The runtime host is unreachable | The gateway returns 502 with upstream_error. |
Limits
- Prices, regional hosts, and quotas are in the SageMaker real-time inference documentation.
- The
base_urlhost andaws_regionmust be the same region: the gateway signs foraws_regionand sends to thebase_urlhost. - The container owns the request and response schema.
- If the SageMaker call fails with a rate limit, a server error, an authentication error, or a transport error, the gateway tries the next eligible target. Provider attempts and fallback has the rules.
- A listener on a non-loopback address needs TLS and network controls.
Next steps
- Cloud Provider Configuration: AWS and other cloud target fields.
- Runtime Request Families: request families and their policy stages.