Instructions to use forestav/medical_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use forestav/medical_model with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("forestav/medical_model", dtype="auto") - llama-cpp-python
How to use forestav/medical_model with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="forestav/medical_model", filename="unsloth.F16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use forestav/medical_model with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf forestav/medical_model:F16 # Run inference directly in the terminal: llama-cli -hf forestav/medical_model:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf forestav/medical_model:F16 # Run inference directly in the terminal: llama-cli -hf forestav/medical_model:F16
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 forestav/medical_model:F16 # Run inference directly in the terminal: ./llama-cli -hf forestav/medical_model:F16
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 forestav/medical_model:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf forestav/medical_model:F16
Use Docker
docker model run hf.co/forestav/medical_model:F16
- LM Studio
- Jan
- Ollama
How to use forestav/medical_model with Ollama:
ollama run hf.co/forestav/medical_model:F16
- Unsloth Studio new
How to use forestav/medical_model 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 forestav/medical_model 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 forestav/medical_model to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for forestav/medical_model to start chatting
- Pi new
How to use forestav/medical_model with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf forestav/medical_model:F16
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": "forestav/medical_model:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use forestav/medical_model with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf forestav/medical_model:F16
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 forestav/medical_model:F16
Run Hermes
hermes
- Docker Model Runner
How to use forestav/medical_model with Docker Model Runner:
docker model run hf.co/forestav/medical_model:F16
- Lemonade
How to use forestav/medical_model with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull forestav/medical_model:F16
Run and chat with the model
lemonade run user.medical_model-F16
List all available models
lemonade list
llm.create_chat_completion(
messages = "No input example has been defined for this model task."
)Uploaded model
- Developed by: forestav
- License: apache-2.0
- Finetuned from model: unsloth/llama-3.2-1b-instruct-bnb-4bit
Model description
This model is a refined version of a LoRA adapter trained on the unsloth/Llama-3.2-3B-Instruct model using the FineTome-100k dataset. The finetuned model uses fewer parameters (1B vs. 3B) to achieve faster training and improved adaptability for specific tasks, such as medical applications.
Key adjustments:
- Reduced Parameter Count: The model was downsized to 1B parameters to improve training efficiency and ease customization.
- Adjusted Learning Rate: A smaller learning rate was used to prevent overfitting and mitigate catastrophic forgetting. This ensures the model retains its general pretraining knowledge while learning new tasks effectively.
The finetuning dataset, ruslanmv/ai-medical-chatbot, contains only 257k rows, which necessitated careful hyperparameter tuning to avoid over-specialization.
Hyperparameters and explanations
Learning rate:
2e-5
A smaller learning rate reduces the risk of overfitting and catastrophic forgetting, particularly when working with models containing fewer parameters.Warm-up steps:
5
Warm-up allows the optimizer to gather gradient statistics before training at the full learning rate, improving stability.Per device train batch size:
2
Each GPU processes 2 training samples per step. This setup is suitable for resource-constrained environments.Gradient accumulation steps:
4
Gradients are accumulated over 4 steps to simulate a larger batch size (effective batch size: 8) without exceeding memory limits.Optimizer:
AdamW with 8-bit Quantization- AdamW: Adds weight decay to prevent overfitting.
- 8-bit Quantization: Reduces memory usage by compressing optimizer states, facilitating faster training.
Weight decay:
0.01
Standard weight decay value effective across various training scenarios.Learning rate scheduler type:
Linear
Gradually decreases the learning rate from the initial value to zero over the course of training.
Quantization details
The model is saved in 16-bit GGUF format, which:
- Ensures 100% accuracy retention.
- Trades off speed and memory for improved precision.
Training optimization
Training was accelerated by 2x using Unsloth in combination with Hugging Face's TRL library.
- Downloads last month
- 9
16-bit

# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="forestav/medical_model", filename="unsloth.F16.gguf", )