Text Generation
Transformers
Safetensors
English
diffusion_gemma
image-text-to-text
diffusion-language-model
generative-ui
openui
openui-lang
gemma
conversational
Instructions to use thesysdev/OUI-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thesysdev/OUI-1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thesysdev/OUI-1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("thesysdev/OUI-1") model = AutoModelForMultimodalLM.from_pretrained("thesysdev/OUI-1", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thesysdev/OUI-1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thesysdev/OUI-1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thesysdev/OUI-1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/thesysdev/OUI-1
- SGLang
How to use thesysdev/OUI-1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "thesysdev/OUI-1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thesysdev/OUI-1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "thesysdev/OUI-1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thesysdev/OUI-1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use thesysdev/OUI-1 with Docker Model Runner:
docker model run hf.co/thesysdev/OUI-1
model card: OUI-1 capitalisation
Browse files
README.md
CHANGED
|
@@ -13,9 +13,9 @@ language:
|
|
| 13 |
- en
|
| 14 |
---
|
| 15 |
|
| 16 |
-
#
|
| 17 |
|
| 18 |
-
**
|
| 19 |
DiffusionGemma 26B-A4B-it that writes user interface screens in
|
| 20 |
[openui-lang](https://openui.com/docs), the declarative UI language behind
|
| 21 |
[OpenUI](https://github.com/thesysdev/openui). It scores 71.7% on
|
|
@@ -41,8 +41,8 @@ it, so a screen arrives in about a second on one GPU.
|
|
| 41 |
|
| 42 |
The [generative-ui-bench](https://github.com/thesysdev/generative-ui-bench) protocol: 46 screen
|
| 43 |
briefs in five size bands, 4 generations each, thinking off, one shared system prompt for every
|
| 44 |
-
model, scored by the benchmark's own validator. Base DiffusionGemma 24/184 (13.0%);
|
| 45 |
-
132/184 (71.7%). Raw outputs for
|
| 46 |
rescored offline.
|
| 47 |
|
| 48 |

|
|
@@ -74,7 +74,7 @@ vLLM 0.24 or newer.
|
|
| 74 |
```bash
|
| 75 |
pip install "vllm>=0.24"
|
| 76 |
vllm serve thesysdev/OUI-1 --trust-remote-code --max-model-len 16384 --quantization fp8 \
|
| 77 |
-
--served-model-name
|
| 78 |
--enable-auto-tool-choice --tool-call-parser gemma4
|
| 79 |
```
|
| 80 |
|
|
@@ -101,7 +101,7 @@ brief = """Status page for the platform team. Build a single screen for this. It
|
|
| 101 |
2. a short note on the most recent incident and when it was resolved
|
| 102 |
Cover every numbered item."""
|
| 103 |
r = client.chat.completions.create(
|
| 104 |
-
model="
|
| 105 |
messages=[{"role": "system", "content": system}, {"role": "user", "content": brief}],
|
| 106 |
max_tokens=4096,
|
| 107 |
stream=False,
|
|
@@ -145,7 +145,7 @@ tools = [{"type": "function", "function": {"name": "get_weather",
|
|
| 145 |
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
|
| 146 |
msgs = [{"role": "system", "content": system + TOOL_RULE},
|
| 147 |
{"role": "user", "content": "weather in Goa this weekend"}]
|
| 148 |
-
r = client.chat.completions.create(model="
|
| 149 |
m = r.choices[0].message
|
| 150 |
call = m.tool_calls[0] # get_weather({"city": "Goa"})
|
| 151 |
|
|
@@ -155,7 +155,7 @@ msgs.append({"role": "assistant", "content": m.content or "",
|
|
| 155 |
"function": {"name": call.function.name,
|
| 156 |
"arguments": call.function.arguments}}]})
|
| 157 |
msgs.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})
|
| 158 |
-
r2 = client.chat.completions.create(model="
|
| 159 |
print(r2.choices[0].message.content) # the screen, built from the tool result
|
| 160 |
```
|
| 161 |
|
|
|
|
| 13 |
- en
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# OUI-1
|
| 17 |
|
| 18 |
+
**OUI-1** is the first diffusion model built for generative UI. It is a finetune of Google's
|
| 19 |
DiffusionGemma 26B-A4B-it that writes user interface screens in
|
| 20 |
[openui-lang](https://openui.com/docs), the declarative UI language behind
|
| 21 |
[OpenUI](https://github.com/thesysdev/openui). It scores 71.7% on
|
|
|
|
| 41 |
|
| 42 |
The [generative-ui-bench](https://github.com/thesysdev/generative-ui-bench) protocol: 46 screen
|
| 43 |
briefs in five size bands, 4 generations each, thinking off, one shared system prompt for every
|
| 44 |
+
model, scored by the benchmark's own validator. Base DiffusionGemma 24/184 (13.0%); OUI-1
|
| 45 |
+
132/184 (71.7%). Raw outputs for OUI-1 are committed to the benchmark repo so the number can be
|
| 46 |
rescored offline.
|
| 47 |
|
| 48 |

|
|
|
|
| 74 |
```bash
|
| 75 |
pip install "vllm>=0.24"
|
| 76 |
vllm serve thesysdev/OUI-1 --trust-remote-code --max-model-len 16384 --quantization fp8 \
|
| 77 |
+
--served-model-name OUI-1 --max-num-seqs 4 \
|
| 78 |
--enable-auto-tool-choice --tool-call-parser gemma4
|
| 79 |
```
|
| 80 |
|
|
|
|
| 101 |
2. a short note on the most recent incident and when it was resolved
|
| 102 |
Cover every numbered item."""
|
| 103 |
r = client.chat.completions.create(
|
| 104 |
+
model="OUI-1",
|
| 105 |
messages=[{"role": "system", "content": system}, {"role": "user", "content": brief}],
|
| 106 |
max_tokens=4096,
|
| 107 |
stream=False,
|
|
|
|
| 145 |
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
|
| 146 |
msgs = [{"role": "system", "content": system + TOOL_RULE},
|
| 147 |
{"role": "user", "content": "weather in Goa this weekend"}]
|
| 148 |
+
r = client.chat.completions.create(model="OUI-1", tools=tools, max_tokens=4096, messages=msgs)
|
| 149 |
m = r.choices[0].message
|
| 150 |
call = m.tool_calls[0] # get_weather({"city": "Goa"})
|
| 151 |
|
|
|
|
| 155 |
"function": {"name": call.function.name,
|
| 156 |
"arguments": call.function.arguments}}]})
|
| 157 |
msgs.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})
|
| 158 |
+
r2 = client.chat.completions.create(model="OUI-1", tools=tools, max_tokens=4096, messages=msgs)
|
| 159 |
print(r2.choices[0].message.content) # the screen, built from the tool result
|
| 160 |
```
|
| 161 |
|