Pure JAX on G5g: Serving Gemma 4 on Graviton and a T4G A developer has published a step-by-step guide for serving Google's Gemma 4 model on an AWS EC2 G5g instance using pure JAX, targeting the cheapest whole NVIDIA GPU available on AWS. The guide details deploying on the Arm-based Graviton2 host with a T4G GPU, using an MCP server for management, and emphasizes cost efficiency and honest benchmarking. This article provides a step by step deployment guide for serving Google's Gemma 4 on an AWS EC2 G5g instance using pure JAX. The code is here: This project aims to serve a modern open model on the cheapest whole CUDA GPU AWS will rent you, and to measure honestly what that costs. Probably The T4G is a Turing chip from 2018. It has no bfloat16 and no fp8. But it is cheap, it is available when nothing else is, and it is attached to a Graviton2 host — which makes G5g the rare hardware axis that almost nothing in the ML ecosystem targets: aarch64 and CUDA together . So let's give pure JAX a shot on G5g G5g instances pair an AWS Graviton2 64-bit Arm processor with NVIDIA T4G Tensor Core GPUs. At g5g.xlarge they are the cheapest EC2 instance carrying a whole NVIDIA GPU , and the only Arm-based GPU family AWS offers. Two GPU instances are cheaper per hour and neither can serve this model us-east-1, Linux, on-demand, checked against the Pricing API on 2026-08-28 : g6f.large at g6f that fits is g6f.4xlarge at $0.9500, which is 1.7x this rig's g5g.2xlarge . g4ad.xlarge at Among whole NVIDIA GPUs, G5g is the floor: g5g.xlarge at $0.4200, and the next one up is g4dn.xlarge at $0.5260. More information is available here: https://aws.amazon.com/ec2/instance-types/g5g/ https://aws.amazon.com/ec2/instance-types/g5g/ The default in this rig is g5g.2xlarge — 1 GPU, 8 vCPU, 16 GiB RAM. Note- the T4G reports 15,360 MiB of device memory, not the nominal 16 GB. Budget against the measured number. Gemma is Google's family of open models built from the same research as Gemini. This rig serves google/gemma-4-E2B-it , the instruction-tuned reference release. JAX is Google's array computing library — NumPy semantics, composable transformations, and compilation to XLA. On NVIDIA hardware, pip supplies the CUDA libraries, so there is nothing to build. More information is available here: "Pure JAX" here is literal. The engine is this repo's own Gemma 4 port driven by a JAX generation loop behind an OpenAI-compatible FastAPI server, running under systemd. You need four things before starting: us-east-1 pip The instance profile needs AmazonSSMManagedInstanceCore plus read access to your Secrets Manager secret and your S3 cache bucket. There is no inbound SSH rule and no private key — all remote administration goes over SSM Run Command. Clone the monorepo and install the control plane: git clone https://github.com/xbill9/gemma4-dev cd gemma4-dev/gpu-jax-g5g-2b pip install -r requirements.txt That installs boto3 and FastMCP only. Nothing here needs a GPU — the GPU is on the other end. python3 -m unittest discover -s tests -v 105 tests, fully offline. Every cloud, subprocess, and network boundary is mocked. If these do not pass, do not launch an instance. The whole rig is driven by an MCP server exposing a devops agent: ./project-setup.sh This installs the bundled skill and registers .mcp.json : { "mcpServers": { "gpu-jax-g5g-2b": { "command": "python3", "args": ".claude/skills/gpu-jax-g5g-2b-management/mcp/server.py" , "env": { "AWS REGION": "us-east-1", "MODEL NAME": "google/gemma-4-E2B-it", "INSTANCE TYPE": "g5g.2xlarge", "MCP SERVER NAME": "gpu-jax-g5g-2b" } } } } Every tool is now available as mcp gpu-jax-g5g-2b