gabriellarson/jupyter-agent-qwen3-4b-thinking-gguf IQ2_M GGUF - Free GGUF Download is indexed on GraySoft with repository links, GGUF quant files, and Hugging Face metadata. This page helps you pick a local model for guIDE or other runtimes. See related models in the same shard below.
gabriellarson/jupyter-agent-qwen3-4b-thinking-gguf overview
tokenizer = AutoTokenizer.frompretrained(modelname) model = AutoModelForCausalLM.frompretrained( modelname, torchdtype="auto", devicemap="auto" ) # Prepare input prompt = "Analyze this sales dataset and find the top 3 performing products by revenue." messages = [ {"role": "user", "content": prompt} ] text = tokenizer.applychattemplate( messages, tokenize=False, addgenerationprompt=True ) modelinputs = tokenizer([text], returntensors="pt").to(model.device) # Generate response generatedids = model.generate( **modelinputs, maxnewtokens=16384 ) outputids = generatedids[0][len(modelinputs.inputids[0]):].tolist() python try: # Find the end of thinking section () index = len(outputids) - outputids[::-1].index(151668) except ValueError: index = 0 thinkingcontent = tokenizer.decode(outputids[:index], skipspecialtokens=True).strip("\n") content = tokenizer.decode(outputids[index:], skipspecialtokens=True).strip("\n") print("Thinking:", thinkingcontent) print("Response:", content) python tools = [ { "type": "function", "function": { "name": "executecode", "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": "finalanswer", "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} ]
Repository Files & Downloads
| File | Type | Quantization | Size | Link |
|---|---|---|---|---|
| jupyter-agent-qwen3-4B-thinking-F16.gguf | GGUF | F16 | 7.50 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ2_M.gguf | GGUF | IQ2_M | 1.41 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ2_S.gguf | GGUF | IQ2_S | 1.32 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ2_XXS.gguf | GGUF | IQ2_XXS | 1.16 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ3_M.gguf | GGUF | IQ3_M | 1.83 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ3_S.gguf | GGUF | IQ3_S | 1.77 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ3_XXS.gguf | GGUF | IQ3_XXS | 1.56 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ4_NL.gguf | GGUF | IQ4_NL | 2.22 GB | Download |
| jupyter-agent-qwen3-4b-thinking-IQ4_XS.gguf | GGUF | IQ4_XS | 2.11 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q2_K.gguf | GGUF | Q2_K | 1.55 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q3_K_L.gguf | GGUF | Q3_K_L | 2.09 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q3_K_M.gguf | GGUF | Q3_K_M | 1.93 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q3_K_S.gguf | GGUF | Q3_K_S | 1.76 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q4_0.gguf | GGUF | — | 2.21 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q4_K_M.gguf | GGUF | Q4_K_M | 2.33 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q4_K_S.gguf | GGUF | Q4_K_S | 2.22 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q5_0.gguf | GGUF | — | 2.64 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q5_K_M.gguf | GGUF | Q5_K_M | 2.69 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q5_K_S.gguf | GGUF | Q5_K_S | 2.63 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q6_K.gguf | GGUF | Q6_K | 3.08 GB | Download |
| jupyter-agent-qwen3-4b-thinking-Q8_0.gguf | GGUF | — | 3.99 GB | Download |
Model Details Live
Metadata Inspector
Normalized metadata (stored in metadata_json)
{
"metadata": {},
"card_data": {
"license": "apache-2.0",
"library_name": "transformers",
"tags": [
"code",
"jupyter",
"agent",
"data-science",
"qwen",
"thinking"
],
"base_model": [
"jupyter-agent/jupyter-agent-qwen3-4b-thinking"
],
"datasets": [
"jupyter-agent/jupyter-agent-dataset"
],
"language": [
"en",
"code"
],
"pipeline_tag": "text-generation",
"frontmatter": {
"license": "apache-2.0",
"library_name": "transformers",
"tags": [
"code",
"jupyter",
"agent",
"data-science",
"qwen",
"thinking"
],
"base_model": [
"jupyter-agent/jupyter-agent-qwen3-4b-thinking"
],
"datasets": [
"jupyter-agent/jupyter-agent-dataset"
],
"language": [
"en",
"code"
],
"pipeline_tag": "text-generation"
},
"hero_image_url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/jupyter-agent-2/training_dabstep_easy.png",
"summary": "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() `` ### Decoding Thinking and Content For thinking models, you can extract both the reasoning and final response: `python try: # Find the end of thinking section () index = len(output_ids) - output_ids[::-1].index(151668) except ValueError: index = 0 thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip(\"\\n\") content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip(\"\\n\") print(\"Thinking:\", thinking_content) print(\"Response:\", content) ` ### Agentic Usage with Tool Calling The model works best with proper scaffolding for tool calling: `python 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} ] ``",
"quick_links": [],
"benchmark_table_html": "",
"readme_markdown": "---\nlicense: apache-2.0\nlibrary_name: transformers\ntags:\n- code\n- jupyter\n- agent\n- data-science\n- qwen\n- thinking\nbase_model:\n- jupyter-agent/jupyter-agent-qwen3-4b-thinking\ndatasets:\n- jupyter-agent/jupyter-agent-dataset\nlanguage:\n- en\n- code\npipeline_tag: text-generation\n---\n# Jupyter Agent Qwen3-4B Thinking\n\n\n\n**Jupyter Agent Qwen3-4B Thinking** is a fine-tuned version of [Qwen3-4B-Thinking-2507](https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507) specifically optimized for **data science agentic tasks** in Jupyter notebook environments. This model can execute Python code, analyze datasets, and provide step-by-step reasoning with intermediate computations to solve realistic data analysis problems.\n\n- **Model type:** Causal Language Model (Thinking)\n- **Language(s):** English, Python\n- **License:** Apache 2.0\n- **Finetuned from:** [Qwen/Qwen3-4B-Thinking-2507](https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507)\n\n## Key Features\n\n- **Jupyter-native agent** that lives inside notebook environments\n- **Code execution** with pandas, numpy, matplotlib, and other data science libraries\n- **Step-by-step reasoning** with intermediate computations and thinking traces\n- **Dataset-grounded analysis** trained on real Kaggle notebook workflows\n- **Tool calling** for structured code execution and final answer generation\n\n## Performance\n\nOn the [DABStep benchmark](https://huggingface.co/spaces/adyen/DABstep) for data science tasks:\n\n| Model | Easy Tasks | Hard Tasks |\n|-------|------------|------------|\n| Qwen3-4B-Thinking-2507 (Base) | 44.0% | 2.1% |\n| **Jupyter Agent Qwen3-4B Thinking** | **70.8%** | **3.4%** |\n\n**State-of-the-art performance** for small models on realistic data analysis tasks.\n\n## Model Sources\n\n- **Repository:** [jupyter-agent](https://github.com/huggingface/jupyter-agent)\n- **Dataset:** [jupyter-agent-dataset](https://huggingface.co/datasets/jupyter-agent/jupyter-agent-dataset)\n- **Blog post:** [Jupyter Agents: training LLMs to reason with notebooks](https://huggingface.co/blog/jupyter-agent-2)\n- **Demo:** [Jupyter Agent 2](https://huggingface.co/spaces/lvwerra/jupyter-agent-2)\n\n## Usage\n\n### Basic Usage\n\n```python\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\nmodel_name = \"jupyter-agent/jupyter-agent-qwen3-4b-thinking\"\n# Load model and tokenizer\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(\n model_name,\n torch_dtype=\"auto\",\n device_map=\"auto\"\n)\n# Prepare input\nprompt = \"Analyze this sales dataset and find the top 3 performing products by revenue.\"\nmessages = [\n {\"role\": \"user\", \"content\": prompt}\n]\ntext = tokenizer.apply_chat_template(\n messages,\n tokenize=False,\n add_generation_prompt=True\n)\nmodel_inputs = tokenizer([text], return_tensors=\"pt\").to(model.device)\n# Generate response\ngenerated_ids = model.generate(\n **model_inputs,\n max_new_tokens=16384\n)\noutput_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()\n```\n\n### Decoding Thinking and Content\n\nFor thinking models, you can extract both the reasoning and final response:\n\n```python\ntry:\n # Find the end of thinking section (</think>)\n index = len(output_ids) - output_ids[::-1].index(151668)\nexcept ValueError:\n index = 0\nthinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip(\"\\n\")\ncontent = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip(\"\\n\")\nprint(\"Thinking:\", thinking_content)\nprint(\"Response:\", content)\n```\n\n### Agentic Usage with Tool Calling\n\nThe model works best with proper scaffolding for tool calling:\n\n```python\ntools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"execute_code\",\n \"description\": \"Execute Python code in a Jupyter environment\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"code\": {\n \"type\": \"string\",\n \"description\": \"Python code to execute\"\n }\n },\n \"required\": [\"code\"]\n }\n }\n },\n {\n \"type\": \"function\", \n \"function\": {\n \"name\": \"final_answer\",\n \"description\": \"Provide the final answer to the question\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"The final answer\"\n }\n },\n \"required\": [\"answer\"]\n }\n }\n }\n]\n# Include tools in the conversation\nmessages = [\n {\n \"role\": \"system\", \n \"content\": \"You are a data science assistant. Use the available tools to analyze data and provide insights.\"\n },\n {\"role\": \"user\", \"content\": prompt}\n]\n```\n\n## Training Details\n\n### Training Data\n\nThe model was fine-tuned on the [Jupyter Agent Dataset](https://huggingface.co/datasets/jupyter-agent/jupyter-agent-dataset), which contains:\n\n- **51,389 synthetic notebooks** (~0.2B tokens, total 1B tokens)\n- **Dataset-grounded QA pairs** from real Kaggle notebooks\n- **Executable reasoning traces** with intermediate computations\n- **High-quality educational content** filtered and scored by LLMs\n\n### Training Procedure\n\n- **Base Model:** Qwen3-4B-Thinking-2507\n- **Training Method:** Full-parameter fine-tuning (not PEFT)\n- **Optimizer:** AdamW with cosine learning rate scheduling\n- **Learning Rate:** 5e-6\n- **Epochs:** 5 (optimal based on ablation study)\n- **Context Length:** 32,768 tokens\n- **Batch Size:** Distributed across multiple GPUs\n- **Loss:** Assistant-only loss (`assistant_loss_only=True`)\n- **Regularization:** NEFTune noise (α=7) for full-parameter training\n\n### Training Infrastructure\n\n- **Framework:** [TRL](https://github.com/huggingface/trl) with [Transformers](https://github.com/huggingface/transformers)\n- **Distributed Training:** DeepSpeed ZeRO-2 across multiple nodes\n- **Hardware:** Multi-GPU setup with SLURM orchestration\n\n## Evaluation\n\n### Benchmark: DABStep\n\nThe model was evaluated on [DABStep](https://huggingface.co/spaces/adyen/DABstep), a benchmark for data science agents with realistic tasks involving:\n\n- **Dataset analysis** with pandas and numpy\n- **Visualization** with matplotlib/seaborn\n- **Statistical analysis** and business insights\n- **Multi-step reasoning** with intermediate computations\n\nThe model achieves **26.8% improvement** over the base model and **11.1% improvement** over scaffolding alone.\n\n<img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/jupyter-agent-2/training_dabstep_easy.png\" alt=\"DABstep Easy Score\"/>\n\nWe can also see, that the hard score can increase too even though our dataset is focused on easier questions.\n\n<img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/jupyter-agent-2/training_dabstep_hard.png\" alt=\"DABstep Hard Score\"/>\n\n## Limitations and Bias\n\n### Technical Limitations\n\n- **Context window:** Limited to 32K tokens, may struggle with very large notebooks\n- **Tool calling format:** Requires specific scaffolding for optimal performance \n- **Dataset domains:** Primarily trained on Kaggle-style data science tasks\n- **Code execution:** Requires proper sandboxing for safe execution\n\n### Potential Biases\n\n- **Domain bias:** Trained primarily on Kaggle notebooks, may not generalize to all data science workflows\n- **Language bias:** Optimized for English and Python, limited multilingual support\n- **Task bias:** Focused on structured data analysis, may underperform on unstructured data tasks\n\n### Recommendations\n\n- Use in **sandboxed environments** like [E2B](https://e2b.dev/) for safe code execution\n- **Validate outputs** before using in production systems\n- **Review generated code** for security and correctness\n- Consider **domain adaptation** for specialized use cases\n\n## Ethical Considerations\n\n- **Code Safety:** Always execute generated code in secure, isolated environments\n- **Data Privacy:** Be cautious when analyzing sensitive datasets\n- **Verification:** Validate all analytical conclusions and insights\n- **Attribution:** Acknowledge model assistance in data analysis workflows\n\n## Citation\n\n```bibtex\n@misc{jupyteragentqwen3thinking,\n title={Jupyter Agent Qwen3-4B Thinking},\n author={Baptiste Colle and Hanna Yukhymenko and Leandro von Werra},\n year={2025},\n publisher={Hugging Face},\n url={https://huggingface.co/jupyter-agent/jupyter-agent-qwen3-4b-thinking}\n}\n```\n\n## Related Work\n\n- **Dataset:** [jupyter-agent-dataset](https://huggingface.co/datasets/jupyter-agent/jupyter-agent-dataset)\n- **Non-thinking version:** [jupyter-agent-qwen3-4b-instruct](https://huggingface.co/jupyter-agent/jupyter-agent-qwen3-4b-instruct)\n- **Base model:** [Qwen3-4B-Thinking-2507](https://huggingface.co/Qwen/Qwen3-4B-Thinking-2507)\n- **Benchmark:** [DABStep](https://huggingface.co/spaces/adyen/DABstep)\n\n*For more details, see our [blog post](https://huggingface.co/blog/jupyter-agent-2) and [GitHub repository](https://github.com/huggingface/jupyter-agent).*",
"related_quantizations": []
},
"tags": [
"transformers",
"gguf",
"code",
"jupyter",
"agent",
"data-science",
"qwen",
"thinking",
"text-generation",
"en",
"dataset:jupyter-agent/jupyter-agent-dataset",
"base_model:jupyter-agent/jupyter-agent-qwen3-4b-thinking",
"base_model:quantized:jupyter-agent/jupyter-agent-qwen3-4b-thinking",
"license:apache-2.0",
"endpoints_compatible",
"region:us",
"conversational"
],
"likes": 1,
"downloads": 145,
"gated": false,
"private": false,
"last_modified": "2025-09-15T23:48:20.000Z",
"created_at": "2025-09-15T22:37:04.000Z",
"pipeline_tag": "text-generation",
"library_name": "transformers"
}
Source payload excerpt (from Hugging Face API)
{
"_id": "68c895102c401090d61c0dc0",
"id": "gabriellarson/jupyter-agent-qwen3-4b-thinking-GGUF",
"modelId": "gabriellarson/jupyter-agent-qwen3-4b-thinking-GGUF",
"sha": "7aac50d0e787062a6589a42ee44e9188423672f8",
"createdAt": "2025-09-15T22:37:04.000Z",
"lastModified": "2025-09-15T23:48:20.000Z",
"author": "gabriellarson",
"downloads": 145,
"likes": 1,
"gated": false,
"private": false,
"pipeline_tag": "text-generation",
"library_name": "transformers",
"siblings_count": 23
}