Text Generation
Transformers
Safetensors
English
qwen2
text-generation-inference
Code
Reinforcement learning (RL)
Math
conversational
Run this model with HF Jobs
Run prithivMLmods/Diophantus-14B-R1-Instruct on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/prithivMLmods/Diophantus-14B-R1-Instruct. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/prithivMLmods/Diophantus-14B-R1-Instruct on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/prithivMLmods/Diophantus-14B-R1-Instruct. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/prithivMLmods/Diophantus-14B-R1-Instruct. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use prithivMLmods/Diophantus-14B-R1-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Diophantus-14B-R1-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Diophantus-14B-R1-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Diophantus-14B-R1-Instruct") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Diophantus-14B-R1-Instruct", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/Diophantus-14B-R1-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Diophantus-14B-R1-Instruct" # 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/Diophantus-14B-R1-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Diophantus-14B-R1-Instruct
- SGLang
How to use prithivMLmods/Diophantus-14B-R1-Instruct 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/Diophantus-14B-R1-Instruct" \ --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/Diophantus-14B-R1-Instruct", "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/Diophantus-14B-R1-Instruct" \ --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/Diophantus-14B-R1-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Diophantus-14B-R1-Instruct with Docker Model Runner:
docker model run hf.co/prithivMLmods/Diophantus-14B-R1-Instruct
Update README.md
Browse files123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122---license: apache-2.0language:- enbase_model:- Qwen/Qwen2.5-14B-Instruct-1Mpipeline_tag: text-generationlibrary_name: transformerstags:- text-generation-inference- R1- math- RL---# **Diophantus-14B-R1-Instruct**> **Diophantus-14B-R1-Instruct** is based on the Qwen 2.5 14B modality architecture, designed to optimize performance for mathematical reasoning, general-purpose problem solving, and robust policy optimization using distributed reinforcement learning (RL). This model excels in contextual understanding, logical deduction, multi-step reasoning, and optimization-based tasks. It has been fine-tuned using long chain-of-thought datasets, optimization problem-solving corpora, and structured reasoning datasets to improve comprehension, structured responses, and intelligent decision-making.## **Key Improvements**1. **Advanced Mathematical and Logical Reasoning**:Enhanced capabilities for solving complex equations, optimization tasks, symbolic computation, theorem proving, and step-by-step math problem-solving.2. **Robust Policy Optimization**:Fine-tuned for distributed reinforcement learning (RL) tasks, improving decision-making robustness and solution generalization across complex optimization problems.3. **General Knowledge and Problem Solving**:Strong foundation across diverse domains, excelling in answering factual questions and executing structured multi-step reasoning processes.4. **Instruction Following and Adaptability**:Improved performance in understanding complex instructions and adapting to diverse prompts, maintaining coherence across extended conversations.5. **Long-Context Understanding**:Supports up to 128K tokens for input, and can generate up to 8K tokens, ideal for deep, multi-turn dialogues, mathematical derivations, and long-chain logical reasoning.6. **Coding and Algorithmic Mastery**:Excels in code generation, debugging, algorithm design, refactoring, and analysis across multiple programming languages, with a special focus on optimization algorithms.## **Quickstart with transformers**Here's how to load and use the model with the `transformers` library and `apply_chat_template`:```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizermodel_name = "prithivMLmods/Diophantus-14B-R1-Instruct"model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto",device_map="auto")tokenizer = AutoTokenizer.from_pretrained(model_name)prompt = "Explain the key techniques used in robust policy optimization."messages = [{"role": "system", "content": "You are an expert assistant in optimization, reinforcement learning, and general-purpose reasoning."},{"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]```## **Intended Use**1. **Optimization Problem Solving**:Specialized for solving and explaining general optimization problems, including convex, non-convex, and combinatorial optimization.2. **Mathematical and Logical Reasoning**:Excels at solving equations, mathematical proofs, symbolic manipulations, and structured logical reasoning.3. **Reinforcement Learning Applications**:Useful for designing, analyzing, and explaining RL algorithms, particularly robust and distributed RL.4. **Educational and Research Assistance**:Suitable for providing detailed explanations, mathematical derivations, and research-oriented insights for students, educators, and researchers.5. **Coding and Algorithm Development**:Ideal for writing, improving, debugging, and explaining code, with a strong emphasis on optimization algorithms and computational logic.6. **Conversational AI and Chatbots**:Supports intelligent, context-aware dialogue generation for technical domains, education, and professional assistance.7. **Long-Form Technical Content Generation**:Capable of producing extensive, coherent articles, reports, and tutorials, especially for technical and mathematical content.8. **Structured Data Processing**:Analyzes and generates structured outputs such as JSON, tables, and formal proofs, beneficial for data science and automation.## **Limitations**1. **High Hardware Requirements**:Requires substantial memory and high-performance GPUs or TPUs due to large parameter size and long-context processing.2. **Potential Training Biases**:May reflect biases present in optimization-specific datasets or mathematical corpora.3. **Creative Generation Limitations**:Less optimized for freeform creative writing or storytelling compared to technical reasoning.4. **No Real-Time Awareness**:Lacks knowledge of real-world events or developments post-training cutoff.5. **Error Propagation in Long-Chain Tasks**:Small early errors in long mathematical or optimization tasks may propagate in extended outputs.6. **Prompt Sensitivity**:The quality of outputs can be sensitive to prompt clarity and structure, especially for complex optimization or technical questions.
README.md+122-3