Text Generation
Transformers
Safetensors
English
llama
code
structural-engineering
openseespy
scientific-modeling
reinforcement-learning
grpo
autobm
conversational
text-generation-inference
Instructions to use yongqiqng/AutoBM-Seed-Coder-8B-R with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yongqiqng/AutoBM-Seed-Coder-8B-R with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yongqiqng/AutoBM-Seed-Coder-8B-R") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yongqiqng/AutoBM-Seed-Coder-8B-R") model = AutoModelForCausalLM.from_pretrained("yongqiqng/AutoBM-Seed-Coder-8B-R", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yongqiqng/AutoBM-Seed-Coder-8B-R with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yongqiqng/AutoBM-Seed-Coder-8B-R" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yongqiqng/AutoBM-Seed-Coder-8B-R", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yongqiqng/AutoBM-Seed-Coder-8B-R
- SGLang
How to use yongqiqng/AutoBM-Seed-Coder-8B-R 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 "yongqiqng/AutoBM-Seed-Coder-8B-R" \ --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": "yongqiqng/AutoBM-Seed-Coder-8B-R", "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 "yongqiqng/AutoBM-Seed-Coder-8B-R" \ --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": "yongqiqng/AutoBM-Seed-Coder-8B-R", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yongqiqng/AutoBM-Seed-Coder-8B-R with Docker Model Runner:
docker model run hf.co/yongqiqng/AutoBM-Seed-Coder-8B-R
| license: apache-2.0 | |
| language: | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: ByteDance-Seed/Seed-Coder-8B-Reasoning | |
| tags: | |
| - code | |
| - structural-engineering | |
| - openseespy | |
| - scientific-modeling | |
| - reinforcement-learning | |
| - grpo | |
| - autobm | |
| # AutoBM-Seed-Coder-8B-R | |
| Official model release for the paper *Rethinking Scientific Modeling: Toward Physically Consistent and Simulation-Executable Programmatic Generation*. | |
| This model is trained from [`ByteDance-Seed/Seed-Coder-8B-Reasoning`](https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Reasoning) via the **RLA-SPC** two-stage alignment strategy: | |
| - **Stage I — Domain Instruction Fine-Tuning (SFT)** on the CivilInstruct dataset (10,912 samples). | |
| - **Stage II — Self-Play Constraint GRPO (SPC-GRPO)** with the Multi-Granularity Hybrid Reward (MGHR), combining format, AST, and OpenSeesPy execution rewards. | |
| The resulting model generates **executable, physically consistent OpenSeesPy structural modeling code** from natural language building specifications. | |
| ## BMEval Results | |
| | Model | Pass@1 | Pass@5 | Pass@5_period | Pass@5_compliance | Pass@5_strict | Overall Avg | | |
| |-------|--------|--------|---------------|-------------------|---------------|-------------| | |
| | Seed-Coder-8B-R (baseline) | 11.72 | 21.09 | 0.78 | 3.13 | 0.78 | 6.51 | | |
| | **AutoBM-Seed-Coder-8B-R (this model)** | **64.18** | **97.28** | **78.05** | **92.47** | **77.14** | **81.95** | | |
| ## Usage | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| import torch | |
| model_id = "yongqiqng/AutoBM-Seed-Coder-8B-R" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto", | |
| ) | |
| prompt = '''Generate OpenSeesPy code to model a 5-story reinforced concrete frame building: | |
| - Floor height: 3.5 m | |
| - Bay width: 6 m (3 bays in X, 2 bays in Y) | |
| - Seismic intensity: 0.2g | |
| Compute the fundamental period.''' | |
| messages = [{"role": "user", "content": prompt}] | |
| inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device) | |
| outputs = model.generate(inputs, max_new_tokens=4096, temperature=0.6, top_p=0.95, do_sample=True) | |
| print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| ## Training Details | |
| | Stage | Method | Data | | |
| |-------|--------|------| | |
| | Stage I | Supervised Fine-Tuning | CivilInstruct SFT (9,894 train + 202 val) | | |
| | Stage II | SPC-GRPO with MGHR | CivilInstruct RL (455 train + 57 test) | | |
| The MGHR reward function combines: | |
| - `r_fmt` (Format, weight 0.05) — `<think>...</think><answer>...</answer>` structure | |
| - `r_ast` (AST, weight 0.25) — three-tiered OpenSeesPy API coverage | |
| - `r_exec` (Execution, weight 0.70) — sandboxed OpenSeesPy execution + period error grading | |
| See the [paper](https://arxiv.org/abs/2602.07083) and [training code](https://github.com/Jovanqing/AutoBM) for details. | |
| ## Related | |
| - Paper: [arXiv:2602.07083](https://arxiv.org/abs/2602.07083) | |
| - Code: [github.com/Jovanqing/AutoBM](https://github.com/Jovanqing/AutoBM) | |
| - Sample data: [yongqiqng/CivilInstruct-Sample](https://huggingface.co/datasets/yongqiqng/CivilInstruct-Sample) | |
| - Base model: [ByteDance-Seed/Seed-Coder-8B-Reasoning](https://huggingface.co/ByteDance-Seed/Seed-Coder-8B-Reasoning) | |
| ## Citation | |
| ```bibtex | |
| @article{jiang2026rethinking, | |
| title={Rethinking Scientific Modeling: Toward Physically Consistent and Simulation-Executable Programmatic Generation}, | |
| author={Jiang, Yongqing and Wang, Jianze and Shen, Zhiqi and Lin, Zhenghong and Wang, Jiayuan and Yang, Yijian and Dai, Kaoshan and Luo, Haoran}, | |
| journal={arXiv preprint arXiv:2602.07083}, | |
| year={2026} | |
| } | |
| ``` | |
| ## License | |
| Released under the Apache 2.0 License, consistent with the base Seed-Coder-8B-Reasoning model. | |