Instructions to use baseten/math-adam-qwen38_27b-expert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baseten/math-adam-qwen38_27b-expert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="baseten/math-adam-qwen38_27b-expert") 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("baseten/math-adam-qwen38_27b-expert") model = AutoModelForMultimodalLM.from_pretrained("baseten/math-adam-qwen38_27b-expert", 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 baseten/math-adam-qwen38_27b-expert with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "baseten/math-adam-qwen38_27b-expert" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baseten/math-adam-qwen38_27b-expert", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/baseten/math-adam-qwen38_27b-expert
- SGLang
How to use baseten/math-adam-qwen38_27b-expert 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 "baseten/math-adam-qwen38_27b-expert" \ --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": "baseten/math-adam-qwen38_27b-expert", "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 "baseten/math-adam-qwen38_27b-expert" \ --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": "baseten/math-adam-qwen38_27b-expert", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use baseten/math-adam-qwen38_27b-expert with Docker Model Runner:
docker model run hf.co/baseten/math-adam-qwen38_27b-expert
math-adam expert
Final update-200 inference weights from Qwen3.8-27B Exact Math training.
Provenance
Copied without weight changes from baseten/miles-qwen3.8-27b-387ec74f0e48, branch update-00200, immutable commit f76e760e14f4e9b201fe7c984edf840ecf4cb831 (Weights after update 200).
The successful continuation restored original full checkpoint 70 and trained updates 71β200. This repository contains inference weights and tokenizer/configuration, not the native Adam optimizer checkpoint.
Training
- Full-weight BF16 Qwen3.8-27B; original base revision
1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0. - GRPO advantages with clipped PPO policy objective; Adam LR 1e-6, betas 0.9/0.98, weight decay 0.1.
- 1,250 training questions: 350 medium-hard and 900 hard; 16 questions Γ 16 responses per update.
- Output cap 30,720 tokens, context 32,768, medium reasoning effort, maximum completed policy lag 1.
- Continuation hardware: 2 trainer, 5 rollout and 3 validation nodes; 8 H200 GPUs per node. Trainer TP8/DP2.
Evaluation
Fixed disjoint 150-question validation set (50 medium-hard, 100 hard), four seeds each. Update 200 scored 396/600 (66%); original checkpoint 70 scored 228/600 (38%). These are in-domain fixed-cohort results, not a general math benchmark or proof of generalization. Truncations and original parser-zero outcomes are retained.
Use and limitations
Use the tokenizer chat template with thinking enabled and medium reasoning effort, matching training. Architecture requires a compatible Qwen3.8 runtime; the experiment pinned Transformers 5.12.1. No broad serving compatibility is claimed. The model can produce incorrect answers and exhaust its token budget.
Collection visibility is independent of this repository's access settings.
Training and validation curves
These curves compare the published final update-200 Adam model with the replacement SGD + format reward model. The SGD series is the fresh-base SymPy run su2hnigi, not the earlier SGD continuation. Original W&B training histories are unchanged.
The two Adam figures are original W&B PNG exports. The four updated SGD/comparison figures are cropped captures of W&B's rendered export previews after its native PNG download failed.
Original SGD W&B run Β· W&B comparison report
Training shows a running average of 10 with the original measurements visible. Validation is unsmoothed. Adam has 200 training points and 41 validation points; SGD has 200 training points and 21 validation records, of which 20 are fully scored. Curves use completed optimizer updates on the horizontal axis.
Training reward definitions differ. Adam uses its recorded correctness reward (train/reward_mean). New SGD uses rollout/raw_reward = 0.9 Γ correctness + 0.1 Γ valid answer format. Its native rollout step is zero-based, so the plotted completed-update axis is rollout/step + 1. Both validation series measure mathematical correctness with no format bonus; the new run uses eval/validation and eval/completed_updates.
The SGD record at update 180 is incomplete: 291/599 scored responses (48.581%) and one unscored response. The full 600-response accuracy is bounded by 48.50β48.667%. The unresolved response was a completed, format-valid answer whose grader reported βconstant comparison is not numerically comparableβ; it is not evidence of hardware failure. It is kept distinct from complete validation measurements.
Adam training and validation
SGD + format reward training and validation
Adam and SGD + format reward comparison
Adam is blue; SGD + format reward is pink. The training overlay compares recorded reward trajectories with different reward definitions, not equal accuracy measures. Answer instructions, runtime, grader history and hardware also differ, so this is a descriptive comparison rather than an optimizer-only or reward-only causal test.
The gray βAdam incomplete: no observationsβ legend entry is empty; all 41 Adam validation points are complete.
Chart provenance and settings Β· Training data Β· Validation data
- Downloads last month
- 346
Model tree for baseten/math-adam-qwen38_27b-expert
Base model
Qwen/Qwen3.8-27B




