CoolFace
Apppublic

yatin-superintelligence/gemma4-inference

sourceHugging Facegemmaupdated 5mo agoView on Hugging Face
1likes
App README

Gemma 4 E2B — OpenAI-Compatible Inference API

Serves google/gemma-4-E2B-it in full bf16 precision on an A10G GPU (24 GB VRAM, 600 GB/s bandwidth). Exposes a standard OpenAI-compatible /v1/chat/completions endpoint.

Required Space Secrets

Set these in Space Settings → Variables and Secrets:

SecretDescription
HF_TOKENHuggingFace token with access to google/gemma-4-E2B-it
VLLM_API_KEYAny string — used as Bearer token to authenticate requests

API Usage

python
import openai

client = openai.OpenAI(
    base_url="https://yatin-superintelligence--gemma4-inference.hf.space/v1",
    api_key="your-VLLM_API_KEY",
)

response = client.chat.completions.create(
    model="google/gemma-4-E2B-it",
    messages=[{"role": "user", "content": "Hello"}],
    max_tokens=2048,
    temperature=0.6,
)
print(response.choices[0].message.content)

Enabling Thinking / Chain-of-Thought

Pass enable_thinking=True in extra_body. Thinking appears inline in the response wrapped in <think>...</think> tags — before the actual answer.

python
response = client.chat.completions.create(
    model="google/gemma-4-E2B-it",
    messages=[...],
    max_tokens=2048,
    extra_body={
        "chat_template_kwargs": {"enable_thinking": True}
    },
)

Limits

ParameterValue
Max context (input + output)131 072 tokens (128k)
Max output tokens (per request)2 048 (set max_tokens in request)
Concurrent requests4
Precisionbfloat16
GPUA10G small (24 GB, 600 GB/s)