Improve model card and add complete inference example
Browse files
README.md
CHANGED
|
@@ -16,48 +16,89 @@ base_model:
|
|
| 16 |
pipeline_tag: image-text-to-text
|
| 17 |
---
|
| 18 |
|
| 19 |
-
# LevelField-1:
|
| 20 |
|
| 21 |
-
**LevelField-1** is
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
-
- **Format:** Merged weights in safetensors (~20GB), full inference files included
|
| 27 |
-
- **License:** Apache 2.0 — free for commercial use
|
| 28 |
-
- **Developer:** [Level AI (蓝沃AI)](https://www.level-ai.cn)
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
| Capability | Description |
|
| 33 |
|---|---|
|
| 34 |
-
|
|
| 35 |
-
|
|
| 36 |
-
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
| 41 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
## Quickstart
|
| 44 |
|
| 45 |
-
###
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
```bash
|
|
|
|
|
|
|
| 57 |
CUDA_VISIBLE_DEVICES=0 \
|
| 58 |
OMP_NUM_THREADS=1 \
|
| 59 |
-
vllm serve \
|
| 60 |
-
|
| 61 |
--port 18124 \
|
| 62 |
--served-model-name LevelField \
|
| 63 |
--reasoning-parser qwen3 \
|
|
@@ -66,3 +107,118 @@ vllm serve \
|
|
| 66 |
--max-model-len 32768 \
|
| 67 |
--gpu-memory-utilization 0.9 \
|
| 68 |
--mm-processor-cache-type shm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
pipeline_tag: image-text-to-text
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# LevelField-1: Manufacturing Process Planning from Engineering Drawings
|
| 20 |
|
| 21 |
+
**LevelField-1** is an open-source, 9B-parameter multimodal model for **non-standard machining process planning**. It helps process engineers interpret 2D manufacturing drawings and draft machining routes with optimization suggestions.
|
| 22 |
|
| 23 |
+
[Try the online demo](https://smartaps.level-ai.cn/levelField) · [Download model files](https://huggingface.co/level-ai/LevelField/tree/main) · [Level AI](https://www.level-ai.cn)
|
| 24 |
|
| 25 |
+
## Model overview
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
| Attribute | Details |
|
| 28 |
+
|---|---|
|
| 29 |
+
| Developer | Level AI (蓝沃AI) |
|
| 30 |
+
| Base model | [Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) |
|
| 31 |
+
| Parameters / precision | 9B / BF16 |
|
| 32 |
+
| Release format | Merged safetensors weights, approximately 20 GB, with inference configuration files |
|
| 33 |
+
| Languages | Chinese and English |
|
| 34 |
+
| Task | Drawing interpretation and manufacturing process planning |
|
| 35 |
+
| License | Apache 2.0; commercial use is permitted under the license terms |
|
| 36 |
+
|
| 37 |
+
## What the model does
|
| 38 |
|
| 39 |
| Capability | Description |
|
| 40 |
|---|---|
|
| 41 |
+
| Drawing interpretation | Extracts part names, drawing numbers, materials, dimensions, tolerances, surface roughness, and technical requirements. |
|
| 42 |
+
| Process planning | Uses reviewed machining requirements to propose an operation sequence, identify unsuitable processes, and suggest improvements. |
|
| 43 |
+
| Process coverage | Supports the 18 manufacturing process types listed below. |
|
| 44 |
+
|
| 45 |
+
The drawing workflow covers PDF and image documents. The API example below sends a JPEG image; render PDF pages to images before using this API workflow.
|
| 46 |
|
| 47 |
+
The process-planning prompt uses these 18 process types:
|
| 48 |
|
| 49 |
+
| Process | Chinese label |
|
| 50 |
+
|---|---|
|
| 51 |
+
| Turning | 车削 |
|
| 52 |
+
| Milling | 铣削 |
|
| 53 |
+
| Drilling | 钻削 |
|
| 54 |
+
| Grinding | 磨削 |
|
| 55 |
+
| Casting | 铸造 |
|
| 56 |
+
| Forging | 锻造 |
|
| 57 |
+
| Heat treatment | 热处理 |
|
| 58 |
+
| Surface treatment | 表面处理 |
|
| 59 |
+
| Electrical discharge machining (EDM) | 电火花加工 |
|
| 60 |
+
| Bench work | 钳加工 |
|
| 61 |
+
| Assembly | 装配 |
|
| 62 |
+
| Gear machining | 齿加工 |
|
| 63 |
+
| Sheet metal forming | 钣金成型 |
|
| 64 |
+
| Welding | 焊接 |
|
| 65 |
+
| Wire EDM | 线切割 |
|
| 66 |
+
| Laser marking | 激光打标 |
|
| 67 |
+
| Inspection | 检验 |
|
| 68 |
+
| Stock cutting | 下料 |
|
| 69 |
|
| 70 |
## Quickstart
|
| 71 |
|
| 72 |
+
### 1. Try the online demo
|
| 73 |
+
|
| 74 |
+
Use the [LevelField demo](https://smartaps.level-ai.cn/levelField) to explore the drawing-to-process-planning workflow without a local deployment.
|
| 75 |
|
| 76 |
+
### 2. Download the model
|
| 77 |
|
| 78 |
+
```bash
|
| 79 |
+
pip install -U huggingface_hub
|
| 80 |
+
hf download level-ai/LevelField --local-dir ./LevelField
|
| 81 |
+
```
|
| 82 |
|
| 83 |
+
### 3. Start a vLLM server
|
| 84 |
+
|
| 85 |
+
The release documents these deployment requirements:
|
| 86 |
+
|
| 87 |
+
- vLLM 0.19.1 or later.
|
| 88 |
+
- At least one NVIDIA H100 GPU.
|
| 89 |
+
- NVIDIA CUDA 12.9, as reported in the tested environment.
|
| 90 |
+
|
| 91 |
+
GPU memory capacity, concurrency, and image size were not specified in the original deployment notes. Memory requirements depend on workload and serving settings; the approximately 20 GB weight size is not the total GPU memory requirement.
|
| 92 |
+
|
| 93 |
+
In a compatible CUDA environment, install vLLM and launch the server:
|
| 94 |
|
| 95 |
```bash
|
| 96 |
+
pip install 'vllm>=0.19.1'
|
| 97 |
+
|
| 98 |
CUDA_VISIBLE_DEVICES=0 \
|
| 99 |
OMP_NUM_THREADS=1 \
|
| 100 |
+
vllm serve ./LevelField \
|
| 101 |
+
--host 127.0.0.1 \
|
| 102 |
--port 18124 \
|
| 103 |
--served-model-name LevelField \
|
| 104 |
--reasoning-parser qwen3 \
|
|
|
|
| 107 |
--max-model-len 32768 \
|
| 108 |
--gpu-memory-utilization 0.9 \
|
| 109 |
--mm-processor-cache-type shm
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
This configuration uses a 32,768-token serving limit and binds the endpoint to the local machine. The serving limit is a deployment setting, not a claim about the model's maximum supported context length.
|
| 113 |
+
|
| 114 |
+
### 4. Submit a drawing
|
| 115 |
+
|
| 116 |
+
Install the client:
|
| 117 |
+
|
| 118 |
+
```bash
|
| 119 |
+
pip install openai
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
Save a legible drawing as `test.jpg` in your working directory, then run the following request example. The Chinese prompt asks the model to generate a process sequence using the 18 available process types.
|
| 123 |
+
|
| 124 |
+
```python
|
| 125 |
+
import base64
|
| 126 |
+
from openai import OpenAI
|
| 127 |
+
|
| 128 |
+
client = OpenAI(api_key="EMPTY", base_url="http://localhost:18124/v1")
|
| 129 |
+
model = "LevelField"
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
def encode_image_base64(image_path):
|
| 133 |
+
with open(image_path, "rb") as f:
|
| 134 |
+
return base64.b64encode(f.read()).decode("utf-8")
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
image_path = "test.jpg"
|
| 138 |
+
image_base64 = encode_image_base64(image_path)
|
| 139 |
+
|
| 140 |
+
response = client.chat.completions.create(
|
| 141 |
+
model=model,
|
| 142 |
+
messages=[
|
| 143 |
+
{
|
| 144 |
+
"role": "user",
|
| 145 |
+
"content": [
|
| 146 |
+
{
|
| 147 |
+
"type": "text",
|
| 148 |
+
"text": (
|
| 149 |
+
"您是一位工艺工程师。现在给您加工图纸<image>。"
|
| 150 |
+
"请根据可供选择的工艺`车削,铣削,钻削,磨削,铸造,锻造,"
|
| 151 |
+
"热处理,表面处理,电火花加工,钳加工,装配,齿加工,"
|
| 152 |
+
"钣金成型,焊接,线切割,激光打标,检验,下料`,"
|
| 153 |
+
"给出它的工艺序列。"
|
| 154 |
+
),
|
| 155 |
+
},
|
| 156 |
+
{
|
| 157 |
+
"type": "image_url",
|
| 158 |
+
"image_url": {
|
| 159 |
+
"url": f"data:image/jpeg;base64,{image_base64}"
|
| 160 |
+
},
|
| 161 |
+
},
|
| 162 |
+
],
|
| 163 |
+
}
|
| 164 |
+
],
|
| 165 |
+
temperature=0.01,
|
| 166 |
+
max_tokens=2000,
|
| 167 |
+
extra_body={
|
| 168 |
+
"chat_template_kwargs": {"enable_thinking": True}
|
| 169 |
+
},
|
| 170 |
+
)
|
| 171 |
+
|
| 172 |
+
message = response.choices[0].message
|
| 173 |
+
if hasattr(message, "reasoning") and message.reasoning:
|
| 174 |
+
print("【思考过程】")
|
| 175 |
+
print(message.reasoning)
|
| 176 |
+
print()
|
| 177 |
+
print("【最终回答】")
|
| 178 |
+
print(message.content)
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
This example enables thinking through `chat_template_kwargs` and prints the reasoning field when returned, followed by the final answer. Use it with the server configuration above, including `--reasoning-parser qwen3`.
|
| 182 |
+
|
| 183 |
+
For a PNG drawing, change the file path and the data URL MIME type to `image/png`. The image payload follows the [vLLM multimodal input format](https://docs.vllm.ai/en/stable/features/multimodal_inputs/).
|
| 184 |
+
|
| 185 |
+
If generation reaches the 2,000-token output limit before producing a complete answer, increase `max_tokens` within the available context capacity.
|
| 186 |
+
|
| 187 |
+
## Recommended workflow
|
| 188 |
+
|
| 189 |
+
1. Supply a legible drawing with all relevant views and annotations.
|
| 190 |
+
2. Check the extracted requirements against the drawing, especially units, tolerances, materials, and surface finish.
|
| 191 |
+
3. Provide production constraints such as quantity, stock form, available machines, tooling, and inspection capabilities.
|
| 192 |
+
4. Request a process route using the reviewed requirements and constraints.
|
| 193 |
+
5. Have a qualified process engineer validate the route before production use.
|
| 194 |
+
|
| 195 |
+
## Training background
|
| 196 |
+
|
| 197 |
+
Level AI reports fine-tuning and reinforcement training using 100,000 manufacturing drawings and process sheets from 16 factories. Data construction and result validation involved the Level AI engineering team and 36 process engineers with more than 20 years of hands-on experience.
|
| 198 |
+
|
| 199 |
+
The release does not specify the data split, training hyperparameters, reinforcement method, or dataset access and licensing details.
|
| 200 |
+
|
| 201 |
+
## Reported results
|
| 202 |
+
|
| 203 |
+
| Evaluation setting | Reported result |
|
| 204 |
+
|---|---|
|
| 205 |
+
| Internal evaluation | More than 95% alignment between model process reasoning and senior process engineers' decisions |
|
| 206 |
+
| Pilot customer usage | Approximately 60% reduction in process-route drafting time |
|
| 207 |
+
|
| 208 |
+
These are developer-reported results. The release does not provide evaluation sample sizes, scoring criteria, comparison baselines, or uncertainty estimates. The alignment figure should not be interpreted as a general accuracy score, and the time reduction may vary across production settings.
|
| 209 |
+
|
| 210 |
+
## Limitations and intended use
|
| 211 |
+
|
| 212 |
+
LevelField-1 is intended to assist process engineers with interpretation and planning. Generated routes are proposals that require engineering review.
|
| 213 |
+
|
| 214 |
+
- Check small annotations, dense drawings, and ambiguous geometry carefully; extracted details may be incomplete or incorrect.
|
| 215 |
+
- Missing information can lead to unsupported assumptions. Ask the model to identify uncertainty explicitly.
|
| 216 |
+
- A drawing alone does not establish shop-floor feasibility. Validate machine capability, fixtures, tooling, material condition, and inspection requirements.
|
| 217 |
+
- Performance across different industries, drawing conventions, materials, and languages has not been separately documented in this release.
|
| 218 |
+
- The release does not establish validated CNC program generation or autonomous production control.
|
| 219 |
+
|
| 220 |
+
## License and feedback
|
| 221 |
+
|
| 222 |
+
LevelField-1 is released under **Apache 2.0**. Review the repository's license terms before redistribution or commercial integration.
|
| 223 |
+
|
| 224 |
+
For questions or reproducible issues, open a discussion in the [Hugging Face community tab](https://huggingface.co/level-ai/LevelField/discussions). Include the serving version, configuration, prompt, and a shareable example where possible.
|