Chat and text
gemma-2-9b-it: GPU memory and a server to run it
By our estimate gemma-2-9b-it needs about 25 GB of GPU memory and 100 GB of disk with the vLLM (OpenAI-compatible) template. Below: how the figure is worked out, the servers that fit and what they cost now.
- Chat in your browserNo code needed: a private chat page on your own server, opened in your browser, with gemma2:9b already set up. Ready in about 11 minutes on one RTX 2070 SUPER, $0.1722 per hour while it runs.
- API server (for developers)For developers: a server that your own code sends requests to, through an OpenAI-compatible API.
These are estimates from the model's recorded files, not measurements. Real use can need more, for example with longer prompts or several requests at once.
- GPU memory (estimate)
- 25 GB
- Disk
- 100 GB
- Time until it answers
- about 24 min
- Cheapest server that fits
- $0.5872 per hour
Other ways to start gemma-2-9b-it
A smaller build
gemma2:9b needs about 8 GB of GPU memory instead of 25 GB, so it fits a cheaper GPU, with a small loss of quality.
Q4_K_M
$0.1862 per hour, disk included
Access token needed
The publisher asks you to accept its terms before downloading. Accept them on the model's page, create an access token there and store it as a secret named HF_TOKEN before you launch.
About gemma-2-9b-it
- Task
- Chat and text
- Parameters
- 9.2 B
- Stored precision
- BF16
- Template that runs it
- vLLM (OpenAI-compatible)
- Licence
- Gemma Terms of Use
- Model page
- google/gemma-2-9b-it
The licence is set by the model's publisher; read it on the model's own page. We do not give licence advice.
How to run gemma-2-9b-it on a GPU
Four steps from an empty account to a running server.
- 1
Start vLLM (OpenAI-compatible)
Sign up, then start the vLLM (OpenAI-compatible) template with gemma-2-9b-it already set. There is nothing to install on your computer.
- 2
Pick a GPU with at least 25 GB of memory
This page's estimate for gemma-2-9b-it is 25 GB. The cheapest GPU that fits right now is one Tesla V100, $0.5872 per hour.
- 3
Send your first request
The server exposes an OpenAI-compatible endpoint: copy the curl or Python sample further down this page and replace the placeholders.
- 4
Stop it when you are done
A server bills by the hour only while it runs. Stop or delete it from the console and the charge ends.
How much GPU memory gemma-2-9b-it needs
A model's weights must fit in the memory on the graphics card (GPU memory, or VRAM), with room for the text it is working on. More parameters need more memory. Quantisation stores each weight in fewer bits, for example 4 instead of 16, so the same model needs about a quarter of the memory, with a small loss of quality. What GPU memory is
| Build | Weights | Cache | Overhead | Total (estimate) |
|---|---|---|---|---|
| BF16this page | 17.2 GB | 2.6 GB | 1.5 GB | 25 GB |
| Q4_K_Mother build | 5.1 GB | 0.7 GB | 1.2 GB | 8 GB |
Estimate: (weights + cache + overhead) ÷ 0.9 × 1.05, rounded up. Weights are the recorded file sizes, the cache holds one sequence of 8192 tokens, and the overhead is what the serving software needs on top.
These are estimates from the model's recorded files, not measurements. Real use can need more, for example with longer prompts or several requests at once.
Servers that fit gemma-2-9b-it
Chosen from our live catalogue with at least 25 GB of GPU memory. Prices include the disk the launch uses.
Cheapest that fits
Available1× Tesla V100, 32 GB GPU memory
$0.5872 per hour, disk included
Tesla V100 plans and pricesWhat it costs to run
| Server | 1 hour | 8 hours |
|---|---|---|
| 1× Tesla V100Cheapest that fits | $0.5872 | $4.6976 |
| 1× A40Faster option | $1.2312 | $9.8496 |
Hourly price today with the launch disk included, times 1 and 8. It is an estimate: you pay for the time the server runs and see the exact price before you deploy. Stop the server when you are done.
What you get
An OpenAI-compatible chat API on your own server, locked with a key the server creates. Once it runs, send requests like this:
curl http://SERVER_ADDRESS/v1/chat/completions \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "google/gemma-2-9b-it", "messages": [{"role": "user", "content": "Hello!"}]}'from openai import OpenAI
client = OpenAI(base_url="http://SERVER_ADDRESS/v1", api_key="API_KEY")
reply = client.chat.completions.create(
model="google/gemma-2-9b-it",
messages=[{"role": "user", "content": "Hello!"}],
)
print(reply.choices[0].message.content)Replace SERVER_ADDRESS and API_KEY with the address and key shown on the server's Connect tab.
Launch settings
Deploy the vLLM (OpenAI-compatible) template and set these variables at launch:
- MODEL
- google/gemma-2-9b-it
- MAX_MODEL_LEN
- 8192
- HF_TOKEN
- secret:HF_TOKEN
Questions
How much GPU memory does gemma-2-9b-it need?
About 25 GB by our estimate: 17.2 GB of weights, 2.6 GB of cache for 8192 tokens and 1.5 GB of overhead. Servers are chosen with at least 25 GB.
Which GPU do I need for gemma-2-9b-it?
Right now the cheapest of our servers that fits is 1× Tesla V100 with 32 GB of GPU memory.
How long until gemma-2-9b-it answers?
About 24 minutes after launch by our estimate: the machine starts, 18.5 GB of model files and the serving software download, then the server sets itself up.
How do I use gemma-2-9b-it once it runs?
Through an OpenAI-compatible chat API on your server, with a key the server creates.
Do I need an access token for gemma-2-9b-it?
Yes. Accept the publisher's terms on the model's page, create an access token there and store it as a secret named HF_TOKEN before you launch.
Before you start
Two short guides that explain the numbers on this page and the steps to a working server for gemma-2-9b-it.
- How much VRAM do you need?How weights, cache and precision add up to the memory a model asks for.
- Run an open LLM with vLLM on a rented GPUFrom an empty account to an OpenAI-compatible endpoint, step by step.
Ready to try gemma-2-9b-it? Pick a server and start it with the model already set; stop it whenever you like.