Gemma 3 4B Chat

Status: Ready

API Usage (curl)

The space implements an OpenAI-compatible API at /v1/chat/completions.

Basic Request (Anonymous)

curl -X POST https://leon4gr45-fable5-inference.hf.space/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-3-4b-it-qat-q4_0",
    "messages": [{"role": "user", "content": "Hello!"}],
    "max_tokens": 50
  }'
  

Streaming Request

curl -X POST https://leon4gr45-fable5-inference.hf.space/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-3-4b-it-qat-q4_0",
    "messages": [{"role": "user", "content": "Tell me a story."}],
    "stream": true
  }'
  

Priority Access (Authenticated)

If you have an API key, you can provide it in the Authorization header to get priority scheduling in the inference queue.

curl -X POST https://leon4gr45-fable5-inference.hf.space/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gemma-3-4b-it-qat-q4_0",
    "messages": [{"role": "user", "content": "Hello with priority!"}]
  }'