Downloads · 30 days
21
3% of all-time downloads
billwang37/optim-ai-7b-v1
optim-ai-7b-v1 is a text generation model from billwang37. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
A fine-tuned Qwen2.5-Math-7B specialized for operations research and optimal control problems. Given a natural-language problem, OptimAI formulates it mathematically, solves it, and explains connections between optimi…
Downloads · 30 days
21
3% of all-time downloads
All-time downloads
809
Public
Parameters
7.6B
15.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors15.2 GB · 100%
From the Hugging Face model README
A fine-tuned Qwen2.5-Math-7B specialized for operations research and optimal control problems. Given a natural-language problem, OptimAI formulates it mathematically, solves it, and explains connections between optimization theory and optimal control.
A larger v2 (trained on ~16k SFT + ~1.2k DPO) is in progress.
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("billwang37/optim-ai-7b-v1")
model = AutoModelForCausalLM.from_pretrained(
"billwang37/optim-ai-7b-v1",
torch_dtype="auto",
device_map="auto",
)
system = ("You are OptimAI, an expert operations research and optimal control assistant. "
"You formulate optimization problems mathematically, solve them, and explain "
"connections between optimal control theory and operations research.")
problem = "A factory makes 2 products. A yields \$40 profit/unit, B yields \$30..."
messages = [{"role": "system", "content": system},
{"role": "user", "content": problem}]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=600, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
A Gradio demo that runs OptimAI alongside CVXPY and scipy solvers to cross-check its answers is at https://huggingface.co/spaces/billwang37/optim-ai
@misc{wang2026optimai,
author = {Bill Wang},
title = {OptimAI 7B: A fine-tuned LLM for operations research and optimal control},
year = {2026},
url = {https://huggingface.co/billwang37/optim-ai-7b-v1},
}
Author: Bill Wang, University of Oklahoma.