yatin-superintelligence/gemma4-inference
1
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:
API Usage
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.
response = client.chat.completions.create(
model="google/gemma-4-E2B-it",
messages=[...],
max_tokens=2048,
extra_body={
"chat_template_kwargs": {"enable_thinking": True}
},
)