Instructions to use Entz/gpt-oss-20b-pubmed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Entz/gpt-oss-20b-pubmed with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Entz/gpt-oss-20b-pubmed", filename="gpt_oss_20b_pubmed_qa_en.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Entz/gpt-oss-20b-pubmed with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Entz/gpt-oss-20b-pubmed # Run inference directly in the terminal: llama-cli -hf Entz/gpt-oss-20b-pubmed
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Entz/gpt-oss-20b-pubmed # Run inference directly in the terminal: llama-cli -hf Entz/gpt-oss-20b-pubmed
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 Entz/gpt-oss-20b-pubmed # Run inference directly in the terminal: ./llama-cli -hf Entz/gpt-oss-20b-pubmed
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 Entz/gpt-oss-20b-pubmed # Run inference directly in the terminal: ./build/bin/llama-cli -hf Entz/gpt-oss-20b-pubmed
Use Docker
docker model run hf.co/Entz/gpt-oss-20b-pubmed
- LM Studio
- Jan
- vLLM
How to use Entz/gpt-oss-20b-pubmed with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Entz/gpt-oss-20b-pubmed" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Entz/gpt-oss-20b-pubmed", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Entz/gpt-oss-20b-pubmed
- Ollama
How to use Entz/gpt-oss-20b-pubmed with Ollama:
ollama run hf.co/Entz/gpt-oss-20b-pubmed
- Unsloth Studio new
How to use Entz/gpt-oss-20b-pubmed 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 Entz/gpt-oss-20b-pubmed 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 Entz/gpt-oss-20b-pubmed to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Entz/gpt-oss-20b-pubmed to start chatting
- Pi new
How to use Entz/gpt-oss-20b-pubmed with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Entz/gpt-oss-20b-pubmed
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": "Entz/gpt-oss-20b-pubmed" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Entz/gpt-oss-20b-pubmed with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Entz/gpt-oss-20b-pubmed
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 Entz/gpt-oss-20b-pubmed
Run Hermes
hermes
- Docker Model Runner
How to use Entz/gpt-oss-20b-pubmed with Docker Model Runner:
docker model run hf.co/Entz/gpt-oss-20b-pubmed
- Lemonade
How to use Entz/gpt-oss-20b-pubmed with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Entz/gpt-oss-20b-pubmed
Run and chat with the model
lemonade run user.gpt-oss-20b-pubmed-{{QUANT_TAG}}List all available models
lemonade list
gpt-oss-20b-pubmed
This is a fine-tune of the base model unsloth/gpt-oss-20b optimized for generating reasoned, biomedical responses. It emphasizes chain-of-thought (CoT) reasoning in its outputs, making it suitable for applications involving analytical discussions, medical question answering, and logical breakdowns of biomedical topics. The model was fine-tuned using QLoRA with Unsloth for efficiency, targeting a balance of performance and resource usage.
The model is provided in MXFP4 GGUF format for compatibility with llama.cpp, Ollama, or LM Studio.
Model Details
Please check also the github page of the model homepage.
- Base Model: unsloth/gpt-oss-20b (MXFP4 quantized)
- Fine-Tuning Method: QLoRA with rank=64, targeting MoE layers
- Training Epochs: 6
- Dataset: PubMedQA dataset(pqal.jsonl) + my own pseudo-labeled dataset (~7,000 examples, adapted for CoT)
- Max Sequence Length: 4096
- Optimizer: AdamW 8-bit
- Learning Rate: 1e-4
Intended Uses
This model is designed for:
- Generating biomedical responses with structured reasoning.
- Educational tools for medical question answering and critical analysis.
- Interactive chat applications for discussing health, research, or clinical topics.
Example use case: Responding to PubMed-style queries with step-by-step biomedical analysis followed by a concise answer.
Limitations
- The model may exhibit biases inherent in PubMed data, potentially favoring certain medical viewpoints.
- Performance on non-biomedical tasks (e.g., general debate, code generation) may not match the base model.
- Outputs can sometimes be verbose; fine-tune temperature and max_tokens for control.
- Not intended for clinical decision-making or sensitive medical applications without expert oversight.
Evaluation
During fine-tuning:
- Training Loss: Monitored (decreased steadily over epochs).
- Evaluation: Performed on a 10% holdout set after each epoch, showing improved coherence in CoT outputs.
- Perplexity/Qualitative: Responses were manually inspected for logical flow and biomedical relevance.
- Benchmarks: Tested on PubMedQA (500 instances test set, accuracy: 73.6%, made it 19th on the PubMedQA leaderboard https://pubmedqa.github.io/ as of 2025-12-30)
How to Use
With Transformers (Python)
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Entz/gpt-oss-20b-pubmed" # Or local path
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
messages = [
{"role": "system", "content": "You are a medical expert. In responses, append PubMed IDs as (PubMed ID: id) for sourced info."},
{"role": "user", "content": "What are the effects of aspirin on cardiovascular health?"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs, max_new_tokens=4096, temperature=0.7)
print(tokenizer.decode(outputs[0]))
With GGUF (llama.cpp/Ollama)
Download the GGUF file and use with compatible backends like Ollama:
ollama create pubmed-model -m gpt-oss-20b-pubmed.gguf
ollama run pubmed-model
Then prompt in the Ollama interface.
Training Data
The fine-tuning dataset consists of Q&A pairs from PubMedQA, focused on biomedical reasoning and analysis. Data was processed to ensure diversity and coverage of medical topics, with an emphasis on medium-effort CoT (75% reasoning focus).
Ethical Considerations
This model is for research and educational purposes. Users should be aware of potential biases and verify outputs, especially in medical contexts. It adheres to standard open-source guidelines but is not audited for production use.
Acknowledgments
Built using Unsloth for efficient fine-tuning and Hugging Face Transformers. Thanks to the open-source community for tools and base models.
- Downloads last month
- 12
We're not able to determine the quantization variants.