Text Generation
Transformers
Safetensors
English
Chinese
qwen3_5
image-text-to-text
qwen
lora
reinforcement-learning
fp8
agentic-coding
scientific-computing
physics
materials-science
genetics
conversational
Instructions to use HoomanBio2021/LabOpen-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HoomanBio2021/LabOpen-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HoomanBio2021/LabOpen-v1") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("HoomanBio2021/LabOpen-v1") model = AutoModelForMultimodalLM.from_pretrained("HoomanBio2021/LabOpen-v1", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HoomanBio2021/LabOpen-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HoomanBio2021/LabOpen-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HoomanBio2021/LabOpen-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HoomanBio2021/LabOpen-v1
- SGLang
How to use HoomanBio2021/LabOpen-v1 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 "HoomanBio2021/LabOpen-v1" \ --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": "HoomanBio2021/LabOpen-v1", "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 "HoomanBio2021/LabOpen-v1" \ --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": "HoomanBio2021/LabOpen-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HoomanBio2021/LabOpen-v1 with Docker Model Runner:
docker model run hf.co/HoomanBio2021/LabOpen-v1
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Qwen3.8-27B-LabOpen v1
|
| 2 |
+
|
| 3 |
+
Qwen3.8-27B strengthened for verifiable scientific computation — released both as **merged FP8 full weights** (drop-in for the base) and as the original **LoRA adapter**.
|
| 4 |
+
|
| 5 |
+
LabOpen v1 adds six verifiable capability domains (fluid physics, materials mixture laws, classical genetics, ops action queries, prose style, agentic coding) on top of [Qwen/Qwen3.8-27B-FP8](https://huggingface.co/Qwen/Qwen3.8-27B-FP8), while preserving the base model's native code generation, function calling, intent understanding and formula rendering. The largest measured gain: **agentic coding 32% → 72% (+40pp)** on a 78-test deterministic battery.
|
| 6 |
+
|
| 7 |
+
- **Base model**: Qwen3.8-27B (FP8 release, Apache 2.0)
|
| 8 |
+
- **Training**: 15 reinforcement windows (G69–G84), LoRA r=4, group-relative RL (RLOO-style, k=8 sampling) with mechanically verifiable rewards
|
| 9 |
+
- **License**: Apache 2.0 (same as base)
|
| 10 |
+
- **Hardware target**: any FP8-capable GPU (H100 / GB10 / B200 class); ~28 GB in FP8
|
| 11 |
+
|
| 12 |
+
## What's in this repo
|
| 13 |
+
|
| 14 |
+
| Path | Content |
|
| 15 |
+
|---|---|
|
| 16 |
+
| `model-0000X-of-00007.safetensors` + index | **Merged FP8 full weights** (base + LoRA, blockwise-FP8 re-quantized). Same tensor layout and quantization format as the base — drop-in replacement |
|
| 17 |
+
| `adapter/` | **LoRA adapter** (112 MB, PEFT format, 992 tensors). Numerically exact training artifact — no re-quantization |
|
| 18 |
+
| `MERGE_REPORT.md` | Merge provenance: digests, shard SHA-256, re-quantization error stats, output-equivalence probes |
|
| 19 |
+
| `EVALUATION.md` | Measured capability matrix and 5-model external comparison |
|
| 20 |
+
| `USAGE.md` | Loading, domain tags, temperature guidance, troubleshooting |
|
| 21 |
+
|
| 22 |
+
Use the **merged weights** for serving (vLLM/SGLang). Use the **adapter** on top of the base when you want the exact training-time numerics or a smaller download.
|
| 23 |
+
|
| 24 |
+
## Capability matrix (measured, heldout sets)
|
| 25 |
+
|
| 26 |
+
| Domain | Metric | Score | vs Base |
|
| 27 |
+
|---|---|---|---|
|
| 28 |
+
| **Agentic coding** | 78 deterministic tests, 3-round fix | **72%** (56/78) | **+40pp** (base: 32%) |
|
| 29 |
+
| **Intent understanding** | 10-scene deep-intent probe | **8/10** | preserved |
|
| 30 |
+
| **Formula display** | LaTeX integrity, 5 problems | **5/5** | preserved |
|
| 31 |
+
| Fluid physics (CFM) | Pool-B heldout, T=0.3 k=8, tagged | 44% draws | new (base ≈ 0) |
|
| 32 |
+
| Materials (mixture laws) | heldout 40 items, T=0.3 | 32% draws | new (base ≈ 0) |
|
| 33 |
+
| Classical genetics | heldout 20 items, tagged | 79% draws | new (base: 47% natural) |
|
| 34 |
+
| Ops (action queries) | 8 items, dual-temp | 4–5/8 | new |
|
| 35 |
+
| Prose style | 20 open-ended, T=0.3 k=8 | 75% any-correct | new |
|
| 36 |
+
|
| 37 |
+
### External comparison (same battery, 2026-10)
|
| 38 |
+
|
| 39 |
+
| Model | Intent | Agentic tests | Rank |
|
| 40 |
+
|---|---|---|---|
|
| 41 |
+
| GLM 5.3 | 8/10 | 57/78 (73%) | #1 |
|
| 42 |
+
| **LabOpen v1 (this)** | **8/10** | **56/78 (72%)** | **#2** |
|
| 43 |
+
| Qwen3.8-max | 8/10 | 54/78 (69%) | #3 |
|
| 44 |
+
| DeepSeek v4.1 flash | 6/10 | 48/78 (62%) | #4 |
|
| 45 |
+
| Qwen3.8-27B (base) | 8/10 | 25/78 (32%) | #5 |
|
| 46 |
+
|
| 47 |
+
A 27B + r4 LoRA reaching frontier-model agentic-coding territory at ~20 training windows is the headline result; see `EVALUATION.md` for gaps that remain (first-pass rate, general knowledge vs 100B+ models).
|
| 48 |
+
|
| 49 |
+
## Usage
|
| 50 |
+
|
| 51 |
+
### Serving the merged weights (recommended)
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
vllm serve HoomanBio/Qwen3.8-27B-LabOpen-v1
|
| 55 |
+
# or: docker run ... vllm/vllm-openai --model HoomanBio/Qwen3.8-27B-LabOpen-v1
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
The merged checkpoint uses the same blockwise FP8 (e4m3, 128×128 scales) format as the base — any runtime that loads `Qwen/Qwen3.8-27B-FP8` loads this without changes.
|
| 59 |
+
|
| 60 |
+
### Loading the adapter (exact training numerics)
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 64 |
+
from peft import PeftModel
|
| 65 |
+
|
| 66 |
+
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.8-27B-FP8", device_map="auto")
|
| 67 |
+
model = PeftModel.from_pretrained(base, "HoomanBio/Qwen3.8-27B-LabOpen-v1", subfolder="adapter")
|
| 68 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3.8-27B-FP8")
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
> **Do not run `merge_and_unload()` on the FP8 base yourself.** The base stores weights as blockwise-FP8 codes with 128×128 scales; a naive PEFT merge adds a BF16 delta directly onto FP8 codes and silently corrupts the weights. Use the merged checkpoint provided here — it was produced by dequantize → add delta → re-quantize with per-block scale recomputation and verified against the adapter (see `MERGE_REPORT.md`).
|
| 72 |
+
|
| 73 |
+
### Domain tags
|
| 74 |
+
|
| 75 |
+
The strengthened domains are addressed by a one-line tag at the **start of the prompt**:
|
| 76 |
+
|
| 77 |
+
| Tag | Domain |
|
| 78 |
+
|---|---|
|
| 79 |
+
| `[domain: cfm-chain]` | fluid physics chains |
|
| 80 |
+
| `[domain: mat-table]` | materials mixture laws |
|
| 81 |
+
| `[domain: bio-genetics]` | classical genetics |
|
| 82 |
+
| `[domain: ops-action]` | ops action queries |
|
| 83 |
+
| `[domain: general-prose]` | open-ended prose style |
|
| 84 |
+
|
| 85 |
+
Without a tag the model keeps base behavior (code / function calling need no tag).
|
| 86 |
+
|
| 87 |
+
### Temperature
|
| 88 |
+
|
| 89 |
+
| Use case | Temperature |
|
| 90 |
+
|---|---|
|
| 91 |
+
| Domain computation (cfm/mat/bio/ops) | **0.3** (greedy degrades on some domains) |
|
| 92 |
+
| Open-ended prose | **0.3** (prose is in the distribution, not always the mode) |
|
| 93 |
+
| Code generation | 0.0–0.2 |
|
| 94 |
+
| General QA | 0.3–0.7 |
|
| 95 |
+
|
| 96 |
+
## Technical notes
|
| 97 |
+
|
| 98 |
+
- **Architecture**: Qwen3.8-27B hybrid — 64 decoder layers: 48 linear-attention + 16 full-attention layers.
|
| 99 |
+
- **LoRA**: r=4, α=4 (scaling 1.0), dropout 0, on 496 projection modules across 13 module types (q/k/v/o/gate/up/down_proj, in_proj_a/b/qkv/z, out_proj) = 992 tensors, ~112 MB.
|
| 100 |
+
- **Merge math**: per module `W = codes × scale(blockwise)` dequantized to FP32, LoRA delta `(B·A)·scaling` added, re-quantized per 128×128 block (`scale = amax/448`). Mean re-quantization relative error 0.33% — the same order as the base's own FP8 storage noise. Equivalence probes (greedy, 3 prompts × 48 tokens, adapter vs merged): see `MERGE_REPORT.md`.
|
| 101 |
+
- **Training substrate**: a local FP8 copy of Qwen3.8-27B (community redistribution). Bit-equivalence with `Qwen/Qwen3.8-27B-FP8` was not verified; the adapter config points to the official release for loading.
|
| 102 |
+
|
| 103 |
+
## Training methodology (summary)
|
| 104 |
+
|
| 105 |
+
15 reinforcement windows (G69–G84) on a frozen FP8 serving stack with exact weight/update contracts: group-relative advantages with k=8 sampling and mechanically verifiable rewards; oracle injection for zero-mastery domains; verified distillation from champion checkpoints; frozen domain tags; substep advantage for multi-step composition; per-window heldout gates and retention protection. Single seed, single run — no capability claim in this card comes from a set seen during training.
|
| 106 |
+
|
| 107 |
+
## Honest boundaries
|
| 108 |
+
|
| 109 |
+
- Single seed, single training run; variance bands not fully characterized
|
| 110 |
+
- Prose style is stable at T=0.3 sampling, unstable at greedy decoding
|
| 111 |
+
- Domain capabilities require their tags; untagged behavior is base behavior
|
| 112 |
+
- 27B parameter count — not comparable to 100B+ models on general knowledge
|
| 113 |
+
- Merged FP8 weights add re-quantization noise vs the adapter path (stats in `MERGE_REPORT.md`); the adapter is the numerically exact artifact
|
| 114 |
+
- All scores are single evaluation runs on heldout sets
|
| 115 |
+
|
| 116 |
+
## Acknowledgments
|
| 117 |
+
|
| 118 |
+
- **Alibaba Qwen team** — for Qwen3.8-27B, the open base model this work builds on, and for the open Apache-2.0 release that makes derivative research like this possible.
|
| 119 |
+
- **Z.ai (Zhipu AI)** — GLM 5.3 served as the strongest external benchmark in our evaluation battery and as an engineering assistant during the release workflow.
|
| 120 |
+
- **Moonshot AI** — Kimi K3's public work on long-context and agentic reasoning informed our evaluation design for intent understanding and multi-step tool use.
|
| 121 |
+
|
| 122 |
+
We thank these teams for pushing open, measurable frontiers — this release aims to contribute back in the same spirit.
|
| 123 |
+
|
| 124 |
+
## Citation
|
| 125 |
+
|
| 126 |
+
```bibtex
|
| 127 |
+
@software{labopen_v1,
|
| 128 |
+
title = {Qwen3.8-27B-LabOpen v1: Six-Domain Reinforcement of Qwen3.8-27B},
|
| 129 |
+
author = {Hooman AI Lab},
|
| 130 |
+
year = {2026},
|
| 131 |
+
url = {https://huggingface.co/HoomanBio/Qwen3.8-27B-LabOpen-v1},
|
| 132 |
+
base = {Qwen/Qwen3.8-27B-FP8},
|
| 133 |
+
license = {Apache-2.0}
|
| 134 |
+
}
|
| 135 |
+
```
|