All appsGemma 3 27B

Gemma 3 27B

Deploy Gemma 3 27B with vLLM on Koyeb GPU for high-performance, low-latency, and efficient inference.

Deploy Gemma 3 27B large language model on Koyeb’s high-performance cloud infrastructure.

With one click, get a dedicated GPU-powered inference endpoint ready to handle requests with built-in autoscaling and scale-to-zero.

Deploy Gemma 3 27B for free

Get $200 in credit on your first invoice!

Claim credit

Overview of Gemma 3 27B

Gemma 3 27B is a lightweight, multimodal, state-of-the-art open model from Google, built from the same research and technology used to create the Gemini models. With 27 billion parameters, the model is able to process text and images and excel in tasks like question answering, summarization, and reasoning.

Gemma 3 27B Instruct will be served with the vLLM inference engine, optimized for high-throughput and low-latency model serving. The default GPU for running this model is the Nvidia L40S instance type. You are free to adjust the GPU instance type to fit your workload requirements.

Quickstart

The Gemma 3 27B one-click model is served using the vLLM engine. vLLM is an advanced inference engine designed for high-throughput and low-latency model serving. Optimized for large language models, it provides efficient performance and compatibility with the OpenAI API.

After you deploy the Gemma 3 27B model, copy the Koyeb App public URL similar to https://<YOUR_DOMAIN_PREFIX>.koyeb.app and create a simple Python file with the following content to start interacting with the model.

import os

from openai import OpenAI

client = OpenAI(
  api_key = os.environ.get("OPENAI_API_KEY", "fake"),
  base_url="https://<YOUR_DOMAIN_PREFIX>.koyeb.app/v1",
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Tell me a joke.",
        }
    ],
    model="google/gemma-3-27b-it",
    max_tokens=30,
)

print(chat_completion.to_json(indent=4))

The snippet above is using the OpenAI SDK to interact with the Gemma 3 27B model thanks to vLLM OpenAI compatibility.

Take care to replace the base_url value in the snippet with your Koyeb App public URL.

Executing the Python script will return the model's response to the input message.


python main.py

{
    "id": "chatcmpl-0da4af20-b573-98a0-b976-ae8417af13ac",
    "choices": [
        {
            "finish_reason": "length",
            "index": 0,
            "logprobs": null,
            "message": {
                "content": "Why don't scientists trust atoms?\n\n... Because they make up everything! \n\n😂 \n\nHope that gave you a little chuckle! Would",
                "role": "assistant",
                "tool_calls": [],
                "reasoning_content": null
            },
            "stop_reason": null
        }
    ],
    "created": 1742570036,
    "model": "google/gemma-3-27b-it",
    "object": "chat.completion",
    "usage": {
        "completion_tokens": 30,
        "prompt_tokens": 14,
        "total_tokens": 44,
        "prompt_tokens_details": null
    },
    "prompt_logprobs": null
}

Securing the Inference Endpoint

To ensure that only authenticated requests are processed, we recommend setting up an API key to secure your inference endpoint. Follow these steps to configure the API key:

  1. Generate a strong unique API key to use for authentication
  2. Navigate to your Koyeb Service settings
  3. Add a new environment variable named VLLM_API_KEY and set its value to your secret API key
  4. Save the changes and redeploy to update the service

Once the service is updated, all requests to the inference endpoint will require the API key.

When making requests, ensure the API key is included in the headers. If you are using the OpenAI SDK, you can provide the API key through the api_key parameter when instantiating the OpenAI client. Alternatively, you can set the API key using the OPENAI_API_KEY environment variable. For example:

OPENAI_API_KEY=<YOUR_API_KEY> python main.py

Deploy AI apps to production in minutes

Get started
Koyeb is a developer-friendly serverless platform to deploy apps globally. No-ops, servers, or infrastructure management.
All systems operational
© Koyeb