Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
physics
science
reasoning
math
qwen3.5
conversational
Instructions to use FirstPrinciplesLabs/quark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FirstPrinciplesLabs/quark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="FirstPrinciplesLabs/quark") 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("FirstPrinciplesLabs/quark") model = AutoModelForMultimodalLM.from_pretrained("FirstPrinciplesLabs/quark", 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 FirstPrinciplesLabs/quark with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FirstPrinciplesLabs/quark" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FirstPrinciplesLabs/quark", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/FirstPrinciplesLabs/quark
- SGLang
How to use FirstPrinciplesLabs/quark 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 "FirstPrinciplesLabs/quark" \ --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": "FirstPrinciplesLabs/quark", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "FirstPrinciplesLabs/quark" \ --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": "FirstPrinciplesLabs/quark", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use FirstPrinciplesLabs/quark with Docker Model Runner:
docker model run hf.co/FirstPrinciplesLabs/quark
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,16 +15,16 @@ tags:
|
|
| 15 |
- qwen3.5
|
| 16 |
---
|
| 17 |
|
| 18 |
-
#
|
| 19 |
|
| 20 |
-
|
| 21 |
[Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) with additional post-training: supervised fine-tuning on
|
| 22 |
our curated physics, maths and coding mix.
|
| 23 |
|
| 24 |
It outperforms the base model on a range of benchmarks, and reaches
|
| 25 |
graduate-level science scores comparable to much larger open models.
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
## Results
|
| 30 |
|
|
@@ -33,7 +33,7 @@ up to 131,072 output tokens, and following the Qwen3.5 model card's sampling set
|
|
| 33 |
AIME 2025 is averaged over 16 samples per problem and GPQA Diamond over 8. HLE (text-only, 2,158 questions)
|
| 34 |
is graded by Qwen3.5-27B as judge.
|
| 35 |
|
| 36 |
-
| Benchmark | Qwen3.5-9B | **
|
| 37 |
|---|---|---|---|---|
|
| 38 |
| GPQA Diamond | 81.6 | **87.4** | 0% | 0.3% |
|
| 39 |
| AIME 2025 | 86.9 | **91.7** | 0% | 3.3% |
|
|
@@ -48,7 +48,7 @@ Both models were measured by us with the same setup. "Cut off" is the share of a
|
|
| 48 |
|
| 49 |
| Model | Size | GPQA Diamond | AIME 2025 | HLE |
|
| 50 |
|---|---|---|---|---|
|
| 51 |
-
| **
|
| 52 |
| Qwen3-8B | 8B | 59.6 | 69.3 | 4.4 |
|
| 53 |
| NVIDIA Nemotron Nano 9B v2 | 9B | 64.0 | 72.1 | 6.5 |
|
| 54 |
| gpt-oss-20b | 21B | 71.5 | 91.7 | 10.9 |
|
|
@@ -62,7 +62,7 @@ Both models were measured by us with the same setup. "Cut off" is the share of a
|
|
| 62 |
|
| 63 |
## Training data
|
| 64 |
|
| 65 |
-
|
| 66 |
each with a worked solution written by [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next).
|
| 67 |
Solutions were checked for correctness, and problems overlapping the benchmarks above were removed. Most
|
| 68 |
examples include the full reasoning; a fifth are direct answers, so the model keeps both thinking and
|
|
@@ -70,10 +70,10 @@ non-thinking modes.
|
|
| 70 |
|
| 71 |
## Usage
|
| 72 |
|
| 73 |
-
|
| 74 |
|
| 75 |
```bash
|
| 76 |
-
vllm serve FirstPrinciplesLabs/
|
| 77 |
--max-model-len 135168 --reasoning-parser qwen3
|
| 78 |
```
|
| 79 |
|
|
|
|
| 15 |
- qwen3.5
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# Quark
|
| 19 |
|
| 20 |
+
Quark is a 9B reasoning model for physics, science and maths, built by [FirstPrinciples](https://firstprinciples.com/). The base model is
|
| 21 |
[Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) with additional post-training: supervised fine-tuning on
|
| 22 |
our curated physics, maths and coding mix.
|
| 23 |
|
| 24 |
It outperforms the base model on a range of benchmarks, and reaches
|
| 25 |
graduate-level science scores comparable to much larger open models.
|
| 26 |
|
| 27 |
+
Quark is the first in a series of small, powerful scientific reasoning models. You can use Quark locally or natively on [Theo Platform](https://firstprinciples.com/sign-up).
|
| 28 |
|
| 29 |
## Results
|
| 30 |
|
|
|
|
| 33 |
AIME 2025 is averaged over 16 samples per problem and GPQA Diamond over 8. HLE (text-only, 2,158 questions)
|
| 34 |
is graded by Qwen3.5-27B as judge.
|
| 35 |
|
| 36 |
+
| Benchmark | Qwen3.5-9B | **Quark** | Cut off at 131K: Qwen3.5-9B | Cut off at 131K: Quark |
|
| 37 |
|---|---|---|---|---|
|
| 38 |
| GPQA Diamond | 81.6 | **87.4** | 0% | 0.3% |
|
| 39 |
| AIME 2025 | 86.9 | **91.7** | 0% | 3.3% |
|
|
|
|
| 48 |
|
| 49 |
| Model | Size | GPQA Diamond | AIME 2025 | HLE |
|
| 50 |
|---|---|---|---|---|
|
| 51 |
+
| **Quark** | 9B | **87.4** | **91.7** | **22.7** |
|
| 52 |
| Qwen3-8B | 8B | 59.6 | 69.3 | 4.4 |
|
| 53 |
| NVIDIA Nemotron Nano 9B v2 | 9B | 64.0 | 72.1 | 6.5 |
|
| 54 |
| gpt-oss-20b | 21B | 71.5 | 91.7 | 10.9 |
|
|
|
|
| 62 |
|
| 63 |
## Training data
|
| 64 |
|
| 65 |
+
Quark was fine-tuned on our curated mix of about 200,000 physics, science, maths and coding problems,
|
| 66 |
each with a worked solution written by [Qwen3.8-Flash-Next](https://huggingface.co/Qwen/Qwen3.8-Flash-Next).
|
| 67 |
Solutions were checked for correctness, and problems overlapping the benchmarks above were removed. Most
|
| 68 |
examples include the full reasoning; a fifth are direct answers, so the model keeps both thinking and
|
|
|
|
| 70 |
|
| 71 |
## Usage
|
| 72 |
|
| 73 |
+
Quark runs anywhere Qwen3.5-9B does (Transformers, vLLM, SGLang). We recommend an output budget of 131,072 tokens for best performance.
|
| 74 |
|
| 75 |
```bash
|
| 76 |
+
vllm serve FirstPrinciplesLabs/quark \
|
| 77 |
--max-model-len 135168 --reasoning-parser qwen3
|
| 78 |
```
|
| 79 |
|