Instructions to use chrisjcc/ask-before-answer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chrisjcc/ask-before-answer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chrisjcc/ask-before-answer") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("chrisjcc/ask-before-answer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use chrisjcc/ask-before-answer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chrisjcc/ask-before-answer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chrisjcc/ask-before-answer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/chrisjcc/ask-before-answer
- SGLang
How to use chrisjcc/ask-before-answer 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 "chrisjcc/ask-before-answer" \ --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": "chrisjcc/ask-before-answer", "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 "chrisjcc/ask-before-answer" \ --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": "chrisjcc/ask-before-answer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use chrisjcc/ask-before-answer with Docker Model Runner:
docker model run hf.co/chrisjcc/ask-before-answer
AskBeforeAnswer
The AskBeforeAnswer model is a clarification-seeking language model based on Qwen2.5-7B-Instruct.
Instead of immediately answering an ambiguous question, the model is trained to determine whether clarification is required and, when necessary, identify the missing information and ask a targeted clarification question.
Production Model
This repository contains the exact W&B artifact approved by the project's model promotion procedure.
- Training method: Supervised Fine-Tuning (SFT)
- Model variant:
sft - W&B Registry alias at promotion:
production - W&B artifact:
wandb-registry-Model/AskBeforeAnswer-Models:v0 - W&B artifact digest:
8dd12fd8a79a7f5be7eac5d94def44c1 - Release:
v0.1.5 - Base model:
Qwen/Qwen2.5-7B-Instruct - Dataset:
chrisjcc/ask-before-answer-dataset
The model was obtained directly from the immutable W&B artifact recorded in the promotion record.
The DVC-managed training output is not modified during deployment.
Behavior
The model produces structured responses containing:
- Action: whether to
ClarifyorAnswer - Reasoning: why clarification is or is not required
- Facets: missing information required to disambiguate the question
- Response: either a clarification question or a direct answer
Expected format:
Action: Clarify|Answer
Reasoning: <reasoning>
Facets: <list of missing facets>
Response: <clarifying question or direct answer>
Training
The production winner was selected through the project's experiment selection, verification, and promotion procedure.
The training pipeline supports:
- Supervised Fine-Tuning (SFT)
- Direct Preference Optimization (DPO)
- Group Relative Policy Optimization (GRPO)
- Odds Ratio Preference Optimization (ORPO)
This repository corresponds specifically to the model variant recorded in the promotion record.
Evaluation
Evaluation results are maintained in the project evaluation artifacts.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_name = "Qwen/Qwen2.5-7B-Instruct"
adapter_model_name = "chrisjcc/ask-before-answer"
tokenizer = AutoTokenizer.from_pretrained(
base_model_name,
)
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
)
model = PeftModel.from_pretrained(
model,
adapter_model_name,
)
Dataset
The training datasets are available from:
chrisjcc/ask-before-answer-dataset
The repository contains separate sft and dpo configurations.
Intended Use
This model is intended for research into clarification-seeking behavior in language models, particularly for systems that should distinguish between answerable and underspecified user questions.
Limitations
The model may incorrectly classify questions as ambiguous or unambiguous.
Its generated reasoning and answers should not be treated as authoritative.
The model was trained on English-language data and may not generalize reliably to other languages or domains.
Reproducibility
The model published here was selected through the project's experiment selection, verification, and promotion procedure.
The promotion record identifies the exact W&B artifact version and digest used for deployment.
The local DVC training artifact is treated as immutable during deployment.