Text Generation
Transformers
Safetensors
English
llama4_text
text-generation-inference
meta
conversational
Instructions to use prithivMLmods/MobileLLM-R1-950M-Radiation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/MobileLLM-R1-950M-Radiation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/MobileLLM-R1-950M-Radiation") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/MobileLLM-R1-950M-Radiation") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/MobileLLM-R1-950M-Radiation", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/MobileLLM-R1-950M-Radiation with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/MobileLLM-R1-950M-Radiation" # 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/MobileLLM-R1-950M-Radiation", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/MobileLLM-R1-950M-Radiation
- SGLang
How to use prithivMLmods/MobileLLM-R1-950M-Radiation 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/MobileLLM-R1-950M-Radiation" \ --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/MobileLLM-R1-950M-Radiation", "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/MobileLLM-R1-950M-Radiation" \ --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/MobileLLM-R1-950M-Radiation", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/MobileLLM-R1-950M-Radiation with Docker Model Runner:
docker model run hf.co/prithivMLmods/MobileLLM-R1-950M-Radiation
| library_name: transformers | |
| tags: | |
| - text-generation-inference | |
| - meta | |
| license: fair-noncommercial-research-license | |
| language: | |
| - en | |
| base_model: | |
| - facebook/MobileLLM-R1-950M | |
| pipeline_tag: text-generation | |
|  | |
| # **MobileLLM-R1-950M-Radiation** | |
| > **MobileLLM-R1-950M-Radiation** is a reasoning-focused model based on **facebook/MobileLLM-R1-950M**, fine-tuned for **Abliterated Reasoning** and **polished token probabilities**, enhancing balanced **multilingual generation** across mathematics and general-purpose reasoning. | |
| > It specializes in **event-driven logic**, **structured analysis**, and precise probabilistic modeling—making it ideal for research, education, and lightweight deployment in constrained environments. | |
| --- | |
| ## **Key Features** | |
| 1. **Abliterated Reasoning** | |
| Enhanced reasoning precision through polished token probability distributions, ensuring accurate and context-aware outputs. | |
| 2. **Event Simulation & Logical Analysis** | |
| Models random events, probability-driven reasoning, and logical decision-making reliably. | |
| 3. **Multilingual Mathematical & General-Purpose Problem Solving** | |
| Delivers strong performance in **math**, **probability**, and **structured multilingual tasks**, supporting global research and educational use. | |
| 4. **Hybrid Symbolic-Probabilistic Thinking** | |
| Combines structured logic, probabilistic inference, and chain-of-thought reasoning for robust uncertainty-driven problem-solving. | |
| 5. **Structured Output Mastery** | |
| Generates well-structured outputs in **LaTeX**, **Markdown**, **JSON**, **CSV**, and **YAML**, suitable for technical workflows and research documentation. | |
| 6. **Optimized Lightweight Footprint** | |
| Compact **950M parameter size**, deployable on **edge devices**, **offline clusters**, and **mid-range GPUs**, balancing reasoning capability with efficiency. | |
| --- | |
| ## **Quickstart with Transformers🤗** | |
| ```python | |
| !pip install transformers gradio | |
| ``` | |
| ```python | |
| import gradio as gr | |
| from transformers import pipeline | |
| import torch | |
| # Initialize the model pipeline | |
| model_id = "prithivMLmods/MobileLLM-R1-950M-Radiation" | |
| pipe = pipeline( | |
| "text-generation", | |
| model=model_id, | |
| torch_dtype=torch.float16, | |
| device_map="auto", | |
| ) | |
| def respond(message, history): | |
| # Build prompt from history | |
| prompt = "" | |
| for user_msg, assistant_msg in history: | |
| if user_msg: | |
| prompt += f"User: {user_msg}\n" | |
| if assistant_msg: | |
| prompt += f"Assistant: {assistant_msg}\n" | |
| # Add current message | |
| prompt += f"User: {message}\nAssistant: " | |
| # Generate response with streaming | |
| streamer = pipe.tokenizer.decode | |
| # Generate tokens | |
| inputs = pipe.tokenizer(prompt, return_tensors="pt").to(pipe.model.device) | |
| with torch.no_grad(): | |
| outputs = pipe.model.generate( | |
| **inputs, | |
| max_new_tokens=10000, | |
| temperature=0.7, | |
| do_sample=True, | |
| pad_token_id=pipe.tokenizer.eos_token_id, | |
| ) | |
| # Decode the generated tokens, skipping the input tokens | |
| generated_tokens = outputs[0][inputs['input_ids'].shape[-1]:] | |
| # Stream the output token by token | |
| response_text = "" | |
| for i in range(len(generated_tokens)): | |
| token = generated_tokens[i:i+1] | |
| token_text = pipe.tokenizer.decode(token, skip_special_tokens=True) | |
| response_text += token_text | |
| yield response_text | |
| # Create the chat interface | |
| demo = gr.ChatInterface( | |
| fn=respond, | |
| examples=[ | |
| "Compute: 1-2+3-4+5- ... +99-100.", | |
| ], | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch(share=True) | |
| ``` | |
| --- | |
| ## **Intended Use** | |
| * Balanced multilingual reasoning and probability modeling | |
| * Event simulation, uncertainty analysis, and structured problem solving | |
| * Educational and research-focused reasoning tasks | |
| * Lightweight deployment on edge devices and offline clusters | |
| * Technical content and structured data generation | |
| --- | |
| ## **Limitations** | |
| * Focused on reasoning and mathematics—less suited for creative writing | |
| * limit performance on very complex multi-step reasoning tasks | |
| * Prioritizes structured reasoning and probabilistic accuracy over conversational or emotional tone | |
| * May produce inconsistent outputs for **very long contexts** or cross-domain multi-document tasks |