Instructions to use mkurman/llama-3.2-MEDIT-3B-o1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mkurman/llama-3.2-MEDIT-3B-o1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mkurman/llama-3.2-MEDIT-3B-o1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mkurman/llama-3.2-MEDIT-3B-o1") model = AutoModelForCausalLM.from_pretrained("mkurman/llama-3.2-MEDIT-3B-o1") 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]:])) - llama-cpp-python
How to use mkurman/llama-3.2-MEDIT-3B-o1 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="mkurman/llama-3.2-MEDIT-3B-o1", filename="llama-3.2-MedIT-3B-o1-GGUF.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use mkurman/llama-3.2-MEDIT-3B-o1 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mkurman/llama-3.2-MEDIT-3B-o1 # Run inference directly in the terminal: llama-cli -hf mkurman/llama-3.2-MEDIT-3B-o1
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mkurman/llama-3.2-MEDIT-3B-o1 # Run inference directly in the terminal: llama-cli -hf mkurman/llama-3.2-MEDIT-3B-o1
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf mkurman/llama-3.2-MEDIT-3B-o1 # Run inference directly in the terminal: ./llama-cli -hf mkurman/llama-3.2-MEDIT-3B-o1
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf mkurman/llama-3.2-MEDIT-3B-o1 # Run inference directly in the terminal: ./build/bin/llama-cli -hf mkurman/llama-3.2-MEDIT-3B-o1
Use Docker
docker model run hf.co/mkurman/llama-3.2-MEDIT-3B-o1
- LM Studio
- Jan
- vLLM
How to use mkurman/llama-3.2-MEDIT-3B-o1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mkurman/llama-3.2-MEDIT-3B-o1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mkurman/llama-3.2-MEDIT-3B-o1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mkurman/llama-3.2-MEDIT-3B-o1
- SGLang
How to use mkurman/llama-3.2-MEDIT-3B-o1 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 "mkurman/llama-3.2-MEDIT-3B-o1" \ --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": "mkurman/llama-3.2-MEDIT-3B-o1", "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 "mkurman/llama-3.2-MEDIT-3B-o1" \ --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": "mkurman/llama-3.2-MEDIT-3B-o1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use mkurman/llama-3.2-MEDIT-3B-o1 with Ollama:
ollama run hf.co/mkurman/llama-3.2-MEDIT-3B-o1
- Unsloth Studio
How to use mkurman/llama-3.2-MEDIT-3B-o1 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mkurman/llama-3.2-MEDIT-3B-o1 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for mkurman/llama-3.2-MEDIT-3B-o1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for mkurman/llama-3.2-MEDIT-3B-o1 to start chatting
- Pi
How to use mkurman/llama-3.2-MEDIT-3B-o1 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mkurman/llama-3.2-MEDIT-3B-o1
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mkurman/llama-3.2-MEDIT-3B-o1" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mkurman/llama-3.2-MEDIT-3B-o1 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mkurman/llama-3.2-MEDIT-3B-o1
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mkurman/llama-3.2-MEDIT-3B-o1
Run Hermes
hermes
- Docker Model Runner
How to use mkurman/llama-3.2-MEDIT-3B-o1 with Docker Model Runner:
docker model run hf.co/mkurman/llama-3.2-MEDIT-3B-o1
- Lemonade
How to use mkurman/llama-3.2-MEDIT-3B-o1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mkurman/llama-3.2-MEDIT-3B-o1
Run and chat with the model
lemonade run user.llama-3.2-MEDIT-3B-o1-{{QUANT_TAG}}List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Model Card: mkurman/llama-3.2-MEDIT-3B-o1
This model is a variant of o1-like reasoning that has been fine-tuned on MedIT Solutions Llama 3.2 3B Instruct (a variant of Meta LLama 3.2 3B Instruct). The model introduces specific tags (<Thought> and <Output>) for chain-of-thought style text generation, with a focus on instruct-style reasoning tasks.
This model was fine-tuned for exact matching rather than generating a diverse distribution. Therefore, I recommend testing it with do_sample=False or setting temperature=0.0 for deterministic outputs.
Model Details
Model name: mkurman/llama-3.2-MEDIT-3B-o1
Type: Small Language Model (SLM)
Base model: MedIT Solutions Llama 3.2 3B Instruct (derived from Meta Llama 3.2 3B Instruct)
Architecture: 3 billion parameters
License: llama3.2
Intended Use Cases:
- General question answering
- Instruction-based generation
- Reasoning and chain-of-thought exploration
Not Recommended For:
- Sensitive, real-world medical diagnosis without expert verification
- Highly domain-specific or regulated fields outside the model’s training scope
Usage
Important Notes on Usage
Stop strings:
Because the model uses<Thought>and<Output>tags to separate internal reasoning from the final answer, you must supply</Output>as a stop sequence (or multiple stop sequences, if your framework allows) to avoid the model generating infinitely.Preventing
<|python_tag|>bug:
Sometimes the model starts with<|python_tag|>instead of the intended<Thought>. As a workaround, add"<Thought>\n\n"to the end of your generation prompt (in your chat template) to ensure it starts correctly.Libraries/Tools:
- Ollama and LM Studio: Via GGUF file.
- Jupyter Notebook (or similar): Using the Transformers library.
In Ollama or LM Studio
If you are loading the GGUF file, follow the instructions provided by Ollama or LM Studio. Typically, it involves placing the model file in the appropriate directory and selecting it within the interface.
Example (in Ollama CLI):
ollama run hf.co/mkurman/llama-3.2-MEDIT-3B-o1
You can then issue prompts. Make sure to set stop sequences to </Output> (and possibly </Thought> if your environment supports multiple stops).
In a Jupyter Notebook or Python Script (Transformers)
from transformers import AutoTokenizer, AutoModelForCausalLM
# 1. Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("mkurman/llama-3.2-MEDIT-3B-o1")
model = AutoModelForCausalLM.from_pretrained("mkurman/llama-3.2-MEDIT-3B-o1")
# 2. Define and encode your prompt
# Add '<Thought>\n\n' at the end if you want to ensure
# the model uses the correct reasoning tag.
prompt = [{'role': 'user', 'content': 'Write a short instagram post about hypertension in children. Finish with 3 hashtags'}]
input_ids = tokenizer(tokenizer.apply_chat_template(prompt, tokenize=False, add_generation_prompt=True) + '<Thought>\n\n', return_tensors='pt')
# 3. Generate response with stop sequences (if your generation method supports them)
# If your method doesn't support stop sequences directly,
# you can manually slice the model's output at '</Output>'.
output = model.generate(
input_ids=input_ids,
max_new_tokens=256,
do_sample=False, #or True with temperature 0.0
temperature=0.0,
# Some generation methods or libraries allow specifying stop sequences.
# This is an example if your environment supports it.
# stop=["</Output>"]
)
# 4. Decode the output
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
print(decoded_output)
Note: If your generation library does not allow direct stop sequences, you can manually parse and remove any tokens that appear after </Output>.
Example Prompt/Response
Prompt:
<Talk about the impact of regular exercise on cardiovascular health>
<Thought>
(Remember to add <Thought>\n\n at the end if you see the <|python_tag|> bug.)
Model’s Reasoning (<Thought> block):
Exercise improves heart function by ...
Model’s Final Answer (<Output> block):
Regular exercise has been shown to ...
</Output>
You would display the <Output> portion as the final user-facing answer.
Limitations and Bias
- Hallucination: The model may generate plausible-sounding but incorrect or nonsensical answers.
- Medical Information: Never rely on this model as a source of truth! this model is not a certified medical professional. Always verify with qualified experts before acting on medical advice.
- Biases: The model’s outputs may reflect biases present in the training data. Users should evaluate content for fairness and accuracy.
License and Citation
Please refer to the base model’s Llama 3.2 Community License Agreement and any additional licenses from MedIT Solutions. If you use this model in your work, please cite:
@misc{mkurman2025llama3medit3bo1,
title={{mkurman/llama-3.2-MEDIT-3B-o1}: A fine-tuned Llama 3.2 3B Instruct model for reasoning tasks},
author={Kurman, Mariusz},
year={2025},
howpublished={\url{https://huggingface.co/mkurman/llama-3.2-MEDIT-3B-o1}}
}
Contact
For questions, comments, or issues related to mkurman/llama-3.2-MEDIT-3B-o1, please open an issue on the model repository or contact mkurman.
- Downloads last month
- 107
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="mkurman/llama-3.2-MEDIT-3B-o1", filename="llama-3.2-MedIT-3B-o1-GGUF.gguf", )