Instructions to use ahammad115566/qwen-smeft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ahammad115566/qwen-smeft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ahammad115566/qwen-smeft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ahammad115566/qwen-smeft") model = AutoModelForCausalLM.from_pretrained("ahammad115566/qwen-smeft", 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 ahammad115566/qwen-smeft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ahammad115566/qwen-smeft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ahammad115566/qwen-smeft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ahammad115566/qwen-smeft
- SGLang
How to use ahammad115566/qwen-smeft 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 "ahammad115566/qwen-smeft" \ --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": "ahammad115566/qwen-smeft", "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 "ahammad115566/qwen-smeft" \ --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": "ahammad115566/qwen-smeft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ahammad115566/qwen-smeft with Docker Model Runner:
docker model run hf.co/ahammad115566/qwen-smeft
A domain-adapted large language model for Standard Model Effective Field Theory (SMEFT).
Capabilities
The model has been optimized for:
SMEFT operator reasoning
EFT basis translation
Physics-aware scientific dialogue
Literature-style technical explanation
Structured theoretical question answering
This model is fine-tuned from Qwen3-8B using a curated corpus of SMEFT and particle physics literature.
Note on Qwen3 thinking mode: Qwen3 supports a native
enable_thinkingtoggle in its chat template that wraps reasoning in<think>...</think>blocks. This model was tuned to produce reasoning through its own structured prompt format (not Qwen3's native thinking blocks), so if you build prompts viatokenizer.apply_chat_template(...), setenable_thinking=Falseto avoid mixing the two reasoning styles. The example below uses a raw instruction-style prompt and is unaffected either way.
Quick Start
Installation
pip install torch transformers bitsandbytes accelerate
Inference Example
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
MODEL_NAME = "ahammad115566/qwen-smeft"
RESPONSE_PREFIX = "\n### Response:\n"
# 4-bit quantisation
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True,
)
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(
MODEL_NAME,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
quantization_config=bnb_config,
device_map={"": 0},
trust_remote_code=True,
)
model.eval()
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
# ================= Inference ================
def build_prompt(instruction: str) -> str:
"""Construct the prompt using the format used during fine-tuning."""
return f"\n### Instruction:\n{instruction}\n{RESPONSE_PREFIX}"
@torch.inference_mode()
def ask(instruction: str) -> str:
"""Generate a response to an SMEFT-related instruction."""
prompt = build_prompt(instruction)
inputs = tokenizer(
prompt,
return_tensors="pt",
add_special_tokens=True,
).to(model.device)
output_ids = model.generate(
**inputs,
max_new_tokens=2048,
do_sample=False,
repetition_penalty=1.1,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
new_tokens = output_ids[0][inputs["input_ids"].shape[-1]:]
return tokenizer.decode(
new_tokens,
skip_special_tokens=True,
).strip()
# Example
instruction = """
Which SMEFT operators modify EWPO?
"""
response = ask(instruction)
print(response)
Training Details
| Parameter | Value |
|---|---|
| Base Model | Qwen3 |
| Fine-tuning Method | LoRA (merged) |
| Inference Quantization | 4-bit NF4 (bitsandbytes) |
| Domain | Standard Model Effective Field Theory (SMEFT) |
| Training Corpus | Curated SMEFT and HEP preprints |
| Task Format | Instruction-following scientific QA |
About the model
May hallucinate operator identities.
Domain-locked by design. The model is not suitable for general-purpose tasks.
3620 training examples. Coverage of the SMEFT operator space may be uneven; rare operators or non-Warsaw bases may be answered less reliably.
20% out of domain exmaples are included during the training.
Authors
Ahmed Hammad
Assistant professor
Center of AI and natural science, KIAS, Seoul.
Veronica Sanz
Professor of Theoretical Physics
University of Valencia
Citation
A technical paper describing the dataset construction and fine-tuning procedure is forthcoming.
Please cite the model as:
@article{Hammad:2026bvw,
author = "Hammad, Ahmed and Sanz, Veronica",
title = "{Language-Guided Hypotheses Generation for Sparse SMEFT Analyses}",
eprint = "2608.04100",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
month = "8",
year = "2026"
}
- Downloads last month
- 496