AI Cloud Architect

Deploy decision models with llama.cpp on Amazon SageMaker AI

AWSHow-to by Jyothirmai Kottu, Dmitry Soldatkin, Daniel Quang and Daniel WirjoAWS Artificial Intelligence Blog

Learn how to deploy decision models with llama.cpp on Amazon SageMaker AI. This technical how-to serves OpenAI-compatible chat completions with the AWS Deep Learning Container for llama.cpp, then extends the runtime with SemIf to return probabilities over declared options on CPU or GPU.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

SageMaker AI can serve GGUF models via the AWS Deep Learning Container for llama.cpp, and a SemIf adapter returns option probabilities from final-position logits without generating tokens.

Who it is for

Architects and developers building routing or policy decision models on SageMaker AI who need scores over a fixed set of options.

Key points

  • Standard path serves OpenAI-compatible chat completions through InvokeEndpoint; the SemIf path needs a CodeBuild-built child image.
  • In the post's benchmark, the Qwen3.5-4B Q4_K_M model reached 77.5% accuracy on CPU and 77.9% on a GPU instance (ml.g6e.xlarge), at p50 latency 1.715s vs 0.352s.
  • Results are the vendor's own measurements over 231 JevBench tasks and are not service guarantees.

The same at other vendors