Downloads · 30 days
21
3% of all-time downloads
jupyter-agent/jupyter-agent-qwen3-4b-instruct
jupyter-agent-qwen3-4b-instruct is a text generation model from jupyter-agent. 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.
Downloads · 30 days
21
3% of all-time downloads
All-time downloads
775
Public
Parameters
4B
16.1 GB on disk
Likes
7
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README

Jupyter Agent Qwen3-4B Instruct is a fine-tuned version of Qwen3-4B-Instruct-2507 specifically optimized for data science agentic tasks in Jupyter notebook environments. This model can execute Python code, analyze datasets, and provide clear reasoning to solve realistic data analysis problems.
On the DABStep benchmark for data science tasks:
| Model | Easy Tasks | Hard Tasks |
|---|---|---|
| Qwen3-4B-Instruct-2507 (Base) | 44.0% | 2.1% |
| Jupyter Agent Qwen3-4B Instruct | 70.8% | 3.4% |
State-of-the-art performance for small models on realistic data analysis tasks.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "jupyter-agent/jupyter-agent-qwen3-4b-instruct"
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# Prepare input
prompt = "Analyze this sales dataset and find the top 3 performing products by revenue."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Generate response
generated_ids = model.generate(
**model_inputs,
max_new_tokens=16384
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
For instruct models, you can extract the model's response:
response = tokenizer.decode(output_ids, skip_special_tokens=True)
print("Response:", response)
The model works best with proper scaffolding for tool calling:
tools = [
{
"type": "function",
"function": {
"name": "execute_code",
"description": "Execute Python code in a Jupyter environment",
"parameters": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Python code to execute"
}
},
"required": ["code"]
}
}
},
{
"type": "function",
"function": {
"name": "final_answer",
"description": "Provide the final answer to the question",
"parameters": {
"type": "object",
"properties": {
"answer": {
"type": "string",
"description": "The final answer"
}
},
"required": ["answer"]
}
}
}
]
# Include tools in the conversation
messages = [
{
"role": "system",
"content": "You are a data science assistant. Use the available tools to analyze data and provide insights."
},
{"role": "user", "content": prompt}
]
The model was fine-tuned on the Jupyter Agent Dataset, which contains:
assistant_loss_only=True)The model was evaluated on DABStep, a benchmark for data science agents with realistic tasks involving:
The model achieves 36.3% improvement over the base model and 22.2% improvement over scaffolding alone.
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/jupyter-agent-2/training_dabstep_easy.png" alt="DABstep Easy Score"/>We can also see, that the hard score can increase too even though our dataset is focused on easier questions.
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/jupyter-agent-2/training_dabstep_hard.png" alt="DABstep Hard Score"/>@misc{jupyteragentqwen3instruct,
title={Jupyter Agent Qwen3-4B Instruct},
author={Baptiste Colle and Hanna Yukhymenko and Leandro von Werra},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/jupyter-agent/jupyter-agent-qwen3-4b-instruct}
}
For more details, see our blog post and GitHub repository.