Instructions to use prithivMLmods/Magpie-Qwen-DiMind-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Magpie-Qwen-DiMind-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Magpie-Qwen-DiMind-1.7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Magpie-Qwen-DiMind-1.7B") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Magpie-Qwen-DiMind-1.7B") 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
- vLLM
How to use prithivMLmods/Magpie-Qwen-DiMind-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Magpie-Qwen-DiMind-1.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Magpie-Qwen-DiMind-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Magpie-Qwen-DiMind-1.7B
- SGLang
How to use prithivMLmods/Magpie-Qwen-DiMind-1.7B 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 "prithivMLmods/Magpie-Qwen-DiMind-1.7B" \ --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": "prithivMLmods/Magpie-Qwen-DiMind-1.7B", "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 "prithivMLmods/Magpie-Qwen-DiMind-1.7B" \ --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": "prithivMLmods/Magpie-Qwen-DiMind-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Magpie-Qwen-DiMind-1.7B with Docker Model Runner:
docker model run hf.co/prithivMLmods/Magpie-Qwen-DiMind-1.7B
Magpie-Qwen-DiMind-1.7B
Magpie-Qwen-DiMind-1.7B is a compact yet powerful model for mathematical reasoning, code generation, and structured output tasks, built with a dual-intelligence architecture (DiMind) to handle both quick-response prompts and deep, multi-step problems. With a parameter size of 1.7B, it balances performance and efficiency, using 80% of the Magpie Pro 330k dataset and a modular blend of additional datasets for general-purpose and technical tasks.
GGUF: https://huggingface.co/prithivMLmods/Magpie-Qwen-DiMind-1.7B-GGUF
Key Features
Dual-Intelligence Architecture (DiMind) Integrates rapid-response capabilities for straightforward queries and deep analytical pathways for complex tasks like proofs, derivations, and recursive logic.
Magpie-Tuned Reasoning Core Fine-tuned with 80% of Magpie Pro 330k and curated modular datasets to enhance accuracy, clarity, and depth in math, code, and structured generation.
Mathematical Depth Performs exceptionally on algebra, geometry, calculus, and symbolic logic. Ideal for tutoring, competitions, and academic support.
Lightweight Coding Assistant Understands and writes concise, readable code in Python, JavaScript, and other major languages, including step-by-step breakdowns and bug explanation.
Structured Output Mastery Generates content in structured formats like JSON, Markdown, and LaTeX; ideal for documentation, data templates, and educational materials.
Multilingual Reasoning Handles technical reasoning and translation in over 20 languages, broadening accessibility in global education and multilingual workflows.
Efficient for Mid-Resource Environments The 1.7B parameter count enables excellent reasoning without requiring high-end infrastructure—suitable for local deployment and edge inference.
Quickstart with Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/Magpie-Qwen-DiMind-1.7B"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "Solve the equation: 2(x - 4) + 3 = 11. Show all steps."
messages = [
{"role": "system", "content": "You are a step-by-step math tutor."},
{"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)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Intended Use
- Advanced math and symbolic problem-solving
- Code generation, review, and explanation
- Technical and structured content generation (JSON, Markdown, LaTeX)
- Educational tutoring and reasoning in multiple languages
- Deployment in academic, professional, and resource-aware environments
Limitations
- May produce shallow answers in open-ended creative tasks
- Smaller context window than 7B+ models—best suited for focused reasoning
- Reasoning fidelity may reduce in edge-case or adversarial queries
- Multilingual fluency is geared toward technical use cases, not general conversation
References
- Downloads last month
- 8
