Text Generation
Transformers
Safetensors
English
qwen2
text-generation-inference
general-purpose
math
code
conversational
Run this model with HF Jobs
Run prithivMLmods/OpenRHO-2B-Thinker 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/OpenRHO-2B-Thinker. 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/OpenRHO-2B-Thinker 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/OpenRHO-2B-Thinker. 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/OpenRHO-2B-Thinker. 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/OpenRHO-2B-Thinker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/OpenRHO-2B-Thinker with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/OpenRHO-2B-Thinker") 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/OpenRHO-2B-Thinker") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/OpenRHO-2B-Thinker", 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/OpenRHO-2B-Thinker with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/OpenRHO-2B-Thinker" # 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/OpenRHO-2B-Thinker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/OpenRHO-2B-Thinker
- SGLang
How to use prithivMLmods/OpenRHO-2B-Thinker 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/OpenRHO-2B-Thinker" \ --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/OpenRHO-2B-Thinker", "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/OpenRHO-2B-Thinker" \ --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/OpenRHO-2B-Thinker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/OpenRHO-2B-Thinker with Docker Model Runner:
docker model run hf.co/prithivMLmods/OpenRHO-2B-Thinker
Update README.md
Browse files13 unmodified lines1415161713 unmodified lines- math- code- general-purpose---13 unmodified lines141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311413 unmodified lines- math- code- general-purpose---# **OpenRHO-2B-Thinker**> **OpenRHO-2B-Thinker** is a **general-purpose reasoning model** designed to enhance the cognitive abilities of **edge-deployed large language models (LLMs)** through **reinforcement learning (RL)**. Fine-tuned from **Qwen2-1.5B-Instruct** using the **QwQ distill dataset**, it delivers refined improvements in logical reasoning, structured problem-solving, and lightweight coding — making it highly efficient for **resource-constrained environments**.## **Key Improvements**1. **Advanced Reasoning via RL**:Built to support symbolic reasoning, logical deduction, and structured problem-solving with high efficiency — specifically optimized for real-time use on edge systems.2. **Compact Coding Assistant**:Enhanced understanding of multiple programming paradigms and syntax across Python, JavaScript, C++, and more. Supports in-situ code generation and debugging for embedded coding scenarios.3. **Error Detection & Correction**:Identifies logic errors, malformed data structures (e.g., JSON, XML), and provides corrections quickly — with lightweight inference and minimal latency.4. **Instruction Following & Precision**:Tuned to follow multi-step instructions with improved contextual memory, offering consistent and precise responses across a variety of prompt types.5. **Extended Context Compatibility**:Maintains support for **128K token inputs** and **8K token outputs**, while remaining lean enough for real-time edge usage with low power consumption.## **Quickstart with Transformers**```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizermodel_name = "prithivMLmods/OpenRHO-2B-Thinker"model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto",device_map="auto")tokenizer = AutoTokenizer.from_pretrained(model_name)prompt = "What is a generator function in Python? Explain with an example."messages = [{"role": "system", "content": "You are a helpful and concise AI assistant skilled in programming and 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. **Edge LLM Applications**:Built for embedded AI agents, mobile inference, and low-latency chatbots on constrained hardware.2. **General-Purpose Reasoning**:Effective for real-time logical reasoning, structured deduction, and lightweight problem-solving tasks in everyday applications.3. **Educational & Programming Tools**:Helpful for teaching programming and debugging in interactive, constrained environments (e.g., IoT, robotics kits).4. **Lightweight Conversational Agents**:Enables responsive, intelligent interactions in edge-deployed customer service bots, support kiosks, and automation systems.5. **Multilingual Mini-NLP Tasks**:Supports basic multilingual tasks such as translation, summarization, and information retrieval across multiple languages.6. **Structured Format Generation**:Can generate JSON, Markdown, tables, or tabular outputs in lightweight settings for embedded data workflows.## **Limitations**1. **Hardware Requirements (Minimal but Non-Zero)**:While designed for edge use, optimal performance still benefits from mid-range NPUs, GPUs, or specialized accelerators.2. **Knowledge Cutoff & Real-Time Awareness**:No ability to fetch live data or respond to real-time information beyond its training snapshot.3. **Limited Creative Output**:Less effective for creative writing, abstract thinking, or tasks requiring deep imagination.4. **Prompt Sensitivity**:Outputs can vary based on prompt clarity; structured prompts yield better, more predictable results.5. **Inherited Biases**:May reflect biases from pretraining data. Use caution in sensitive or high-stakes domains.
README.md+98-1