File size: 1,712 Bytes
2ab268b
af94c95
 
 
 
417d92f
af94c95
2ab268b
916abea
 
2ab268b
 
af94c95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: Gemma-4 E2B Uncensored API
emoji: πŸ”“
colorFrom: blue
colorTo: blue
sdk: docker
app_port: 8000
pinned: false
tags:
- ml-intern
---

OpenAI-compatible API for [HauhauCS/Gemma-4-E2B-Uncensored-HauhauCS-Aggressive](https://huggingface.co/HauhauCS/Gemma-4-E2B-Uncensored-HauhauCS-Aggressive)

## Model Details

| Spec | Value |
|------|-------|
| Model | Gemma-4 E2B Uncensored (HauhauCS Aggressive) |
| Quantization | Q8_K_P |
| Context | 131072 tokens |
| Concurrent | 1 request |
| Reasoning | Enabled by default (`--reasoning on --reasoning-format deepseek`) |

## Endpoints

- `POST /v1/chat/completions` β€” Chat completions (streaming recommended)
- `POST /v1/completions` β€” Text completions
- `GET /v1/models` β€” List models
- `GET /health` β€” Health check
- `GET /api-info` β€” JSON status

## Usage

```python
import openai

client = openai.OpenAI(
    base_url="https://nanobotaiagent-gemma-4-e2b-uncensored-api.hf.space/v1",
    api_key="no-key",
    timeout=300.0,
)

response = client.chat.completions.create(
    model="gemma",
    messages=[{"role": "user", "content": "Hello!"}],
    max_tokens=2048,
    stream=True,
)
for chunk in response:
    delta = chunk.choices[0].delta
    rc = getattr(delta, 'reasoning_content', None) or (delta.model_extra or {}).get('reasoning_content')
    if rc:
        print(f"[think] {rc}", end="")
    if delta.content:
        print(delta.content, end="")
```

## Reasoning

Reasoning is enabled by default. Gemma-4 uses `<|channel>thought...<channel|>` blocks
which llama.cpp extracts into the `reasoning_content` field (DeepSeek-compatible).

To disable per-request:
```python
extra_body={"chat_template_kwargs": {"enable_thinking": False}}
```