- Models
- Gemma 4 31B IT
- Deploy
Gemma 4 31B IT
Gemma 4 31B IT is a multimodal instruction-tuned model with text and image input, 256K native context, and Gemma 4 reasoning + tool-call parsers.
Deployment guide
This guide provides step-by-step instructions for deploying AMD Inference Microservice (AIM) container for google/gemma-4-31B-it model in various environments. Follow these instructions to quickly get started with running an AI model on AMD accelerators. This guide assumes MI300X accelerator on the target system.
Prerequisites
- AMD Instinct™ GPU with ROCm support (e.g., MI300X, MI325X)
- Docker installed and configured with GPU support
Docker deployment
Running the container
docker run \ --device=/dev/kfd --device=/dev/dri \ -p 8000:8000 \ amdenterpriseai/aim-google-gemma-4-31b-it:0.13.0-previewCustomizing deployment with environment variables
Customize your deployment with optional environment variables:
docker run \ -e AIM_PRECISION=bf16 \ -e AIM_ACCELERATOR_COUNT=1 \ -e AIM_METRIC=throughput \ -e AIM_PORT=8080 \ --device=/dev/kfd --device=/dev/dri \ -p 8080:8080 \ amdenterpriseai/aim-google-gemma-4-31b-it:0.13.0-previewKubernetes deployment
Deployment
It is possible to deploy AIM using Kubernetes. In this doc a sample Kubernetes deployment manifest is provided.
Create deployment.yaml with the following content:
apiVersion: apps/v1kind: Deploymentmetadata: name: minimal-aim-deployment labels: app: minimal-aim-deploymentspec: progressDeadlineSeconds: 3600 replicas: 1 selector: matchLabels: app: minimal-aim-deployment template: metadata: labels: app: minimal-aim-deployment spec: containers: - name: minimal-aim-deployment image: amdenterpriseai/aim-google-gemma-4-31b-it:0.13.0-preview imagePullPolicy: Always env: - name: AIM_PRECISION value: "auto" - name: AIM_ACCELERATOR_COUNT value: "1" - name: AIM_ACCELERATOR_MODEL value: "auto" - name: AIM_ENGINE value: "vllm" - name: AIM_METRIC value: "latency" - name: AIM_LOG_LEVEL_ROOT value: "INFO" - name: AIM_LOG_LEVEL value: "INFO" - name: AIM_PORT value: "8000" ports: - name: http containerPort: 8000 resources: requests: memory: "16Gi" cpu: "4" amd.com/gpu: "1" limits: memory: "16Gi" cpu: "4" amd.com/gpu: "1" startupProbe: httpGet: path: /v1/models port: http periodSeconds: 10 failureThreshold: 360 livenessProbe: httpGet: path: /health port: http readinessProbe: httpGet: path: /v1/models port: http volumeMounts: - name: ephemeral-storage mountPath: /tmp - name: dshm mountPath: /dev/shm volumes: - name: ephemeral-storage emptyDir: sizeLimit: 256Gi - name: dshm emptyDir: medium: Memory sizeLimit: 32GiCreate a service configuration in service.yaml file:
apiVersion: v1kind: Servicemetadata: name: minimal-aim-deployment labels: app: minimal-aim-deploymentspec: type: ClusterIP ports: - name: http port: 80 targetPort: 8000 selector: app: minimal-aim-deploymentThe deployment can be customized further based on your requirements. It can be applied to Kubernetes cluster using kubectl:
kubectl apply -f . -n <YOUR_K8S_NAMESPACE>This page covers Docker and Kubernetes. The full deployment guide also covers model caching for production, testing your deployment, advanced deployment scenarios, monitoring and troubleshooting, and security considerations.
View full deployment guide