Instructions to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CultriX/Qwen3-8B-Hippocratesv1-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CultriX/Qwen3-8B-Hippocratesv1-GGUF") model = AutoModelForCausalLM.from_pretrained("CultriX/Qwen3-8B-Hippocratesv1-GGUF", 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
- llama.cpp
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
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 CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
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 CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
Use Docker
docker model run hf.co/CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CultriX/Qwen3-8B-Hippocratesv1-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CultriX/Qwen3-8B-Hippocratesv1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
- SGLang
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF 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 "CultriX/Qwen3-8B-Hippocratesv1-GGUF" \ --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": "CultriX/Qwen3-8B-Hippocratesv1-GGUF", "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 "CultriX/Qwen3-8B-Hippocratesv1-GGUF" \ --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": "CultriX/Qwen3-8B-Hippocratesv1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with Ollama:
ollama run hf.co/CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
- Unsloth Studio
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF 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 CultriX/Qwen3-8B-Hippocratesv1-GGUF 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 CultriX/Qwen3-8B-Hippocratesv1-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CultriX/Qwen3-8B-Hippocratesv1-GGUF to start chatting
- Pi
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
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": "CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with Docker Model Runner:
docker model run hf.co/CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
- Lemonade
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-8B-Hippocratesv1-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
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 CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use CultriX/Qwen3-8B-Hippocratesv1-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "CultriX/Qwen3-8B-Hippocratesv1-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Qwen3-8B-MultiStage-Finetune-Hybrid
Model Description
This is a fine-tuned version of the Qwen/Qwen3-8B large language model. It's specialized through a multi-stage training pipeline focusing on medical reasoning, mathematical problem-solving, and general conversational abilities. The model was trained using QLoRA (Quantized Low-Rank Adaptation) and GRPO (Generative Reinforcement Learning with Policy Optimization) for both efficiency and enhanced performance in its specialized domains.
The training methodology uses a progressive approach, building capabilities in distinct areas before consolidating them:
- Medical Reasoning SFT: Initial fine-tuning on a specialized medical dataset to adapt the model to medical explanations and reasoning.
- Mathematical SFT: Further fine-tuning on a mathematical dataset to enhance its ability to solve math problems.
- Mathematical GRPO: A reinforcement learning stage that leverages a reward function to optimize the model's accuracy and ability to provide structured mathematical solutions, particularly with answers in a
\boxed{}format. - General Chat SFT: Final fine-tuning on a diverse chat dataset to improve conversational fluency, helpfulness, and alignment with common dialogue patterns.
Training Details
Training Data
The model was trained on a carefully selected set of public datasets:
- Medical Reasoning:
FreedomIntelligence/medical-o1-reasoning-SFT - Mathematical Reasoning:
unsloth/OpenMathReasoning-mini - General Conversation:
mlabonne/guanaco-llama2-1k
Training Procedure
The model was fine-tuned using a hybrid approach that combines the efficient training capabilities of the unsloth library with the advanced reinforcement learning features of trl:
- Base Model: Qwen/Qwen3-8B
- Quantization: 4-bit NormalFloat (NF4) with double quantization enabled (
bnb_4bit_use_double_quant=True), allowing for efficient training on limited GPU memory. - LoRA Configuration: A rank of
r=24,lora_alpha=32, andlora_dropout=0.05was applied. Key attention and feed-forward projection layers (q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj) were targeted for adaptation. - Gradient Checkpointing: Enabled for memory efficiency, with
recompute_grad=Truefor Unsloth-specific optimizations. - Dynamic Hyperparameters: Batch sizes and gradient accumulation steps were adaptively adjusted per training stage to optimize GPU memory utilization and training throughput.
- Learning Rate Schedule: A cosine decay schedule with a warmup ratio was used. Learning rates were customized for each training stage.
- Optimizer:
adamw_8bit. - Regularization: Gradient norm clipping (
max_grad_norm=1.0) and weight decay (0.01) were applied to prevent exploding gradients and overfitting. - Early Stopping: Applied during SFT stages with a patience of 2 on validation loss, stopping training if no significant improvement was observed.
- Hardware: Training was performed on a single GPU.
- Software Stack: Python, Hugging Face
transformers,unsloth,trl,datasets,wandb(for experiment tracking), andvllm(used during the GRPO stage for efficient text generation).
Usage
This model is designed for text generation, particularly in response to chat-based prompts or specific medical and mathematical queries. To get the best results, ensure your prompts are formatted correctly following the model's training structure.
Load the Model
import torch
from transformers import AutoTokenizer, BitsAndBytesConfig
from unsloth import FastLanguageModel
# Configuration parameters (matching training)
MAX_SEQ_LENGTH = 2048
LOAD_IN_4BIT = True
USE_DOUBLE_QUANT = True
# Initialize BitsAndBytesConfig as used during training
bnb_config = BitsAndBytesConfig(
load_in_4bit=LOAD_IN_4BIT,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16,
bnb_4bit_use_double_quant=USE_DOUBLE_QUANT,
)
# Replace with the actual path to your uploaded model on Hugging Face Hub
model_id = "your-huggingface-username/Qwen3-8B-MultiStage-Finetune-Hybrid"
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token # Ensure pad token is set for generation
# Load the model using Unsloth's optimized loading
model = FastLanguageModel.from_pretrained(
model_id,
quantization_config=bnb_config,
max_seq_length=MAX_SEQ_LENGTH,
device_map="auto", # Automatically maps model to available GPUs
)
# Example for a general chat interaction
messages = [
{"role": "system", "content": "You are a friendly and helpful assistant."},
{"role": "user", "content": "Tell me a short, funny story about a clumsy robot."},
]
# Apply the chat template and tokenize inputs
input_ids = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True, # Important: Add the prompt for the assistant's turn
return_tensors="pt"
).to("cuda") # Move inputs to GPU
# Generate outputs
outputs = model.generate(
input_ids,
max_new_tokens=512, # Maximum tokens to generate
do_sample=True, # Enable sampling for more diverse outputs
temperature=0.7, # Control randomness
top_p=0.95 # Nucleus sampling
)
# Decode and print the generated text, skipping special tokens
print("--- General Chat Example ---")
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# Example for a math problem (model is trained to provide a \boxed{} answer)
math_messages = [
{"role": "system", "content": "You are a math solver. Provide your reasoning within \\ and the final answer in \\boxed{} format."},
{"role": "user", "content": "If a car travels at 80 km/h for 2.5 hours, and then at 60 km/h for another 1.5 hours, what is the total distance traveled?"},
]
# Apply math chat template and tokenize inputs
math_input_ids = tokenizer.apply_chat_template(
math_messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
).to("cuda")
# Generate outputs for the math problem
math_outputs = model.generate(
math_input_ids,
max_new_tokens=512,
do_sample=True,
temperature=0.6, # Slightly lower temperature for more deterministic math outputs
top_p=0.9
)
print("\n--- Math Example ---")
print(tokenizer.decode(math_outputs[0], skip_special_tokens=True))
Limitations and Bias
As a large language model, this fine-tuned Qwen-8B model inherits general limitations and potential biases from its extensive pre-training and fine-tuning data:
Hallucinations: The model may generate information that is factually incorrect or nonsensical. Always cross-reference critical information.
Factual Accuracy: While specialized in medical and mathematical domains, it should not be used as a substitute for professional medical advice, complex mathematical proofs, or any domain requiring absolute precision without independent verification.
Bias: The model's outputs are influenced by the biases present in its training data (both the base model's pre-training and the fine-tuning datasets). This may manifest in stereotypical, harmful, or unfair content.
Language Proficiency: Primarily trained on English text. While some Spanish content was present in the general chat dataset, its proficiency in Spanish or other languages is not guaranteed and may vary.
Context Window: Limited by its max_seq_length (2048 tokens). Very long inputs or extensive multi-turn conversations might lead to degraded performance or truncation of context.
Ethical Considerations
Users should be aware of the following ethical considerations when deploying or using this model:
Not for Critical Applications: This model is intended for research, experimentation, and exploratory applications. It is not designed or validated for use in critical systems where accuracy, reliability, and safety are paramount (e.g., medical diagnosis, financial advice, legal counsel, or decision-making systems impacting individuals).
Responsible AI Use: Deploy and use this model responsibly, adhering to ethical AI guidelines and principles. Implement safeguards to monitor its outputs and prevent potential misuse, discrimination, or the generation of harmful content.
Data Privacy and Security: Do not use this model with sensitive personal identifiable information (PII) or confidential data. Ensure compliance with all relevant data privacy regulations.
Transparency: Be transparent with end-users when they are interacting with an AI system.
Citation
If you use this model or the training methodology, please consider citing the following key components:
Code snippet
@misc{qwen3,
author = {Qwen Team},
title = {Qwen3-8B},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B)}}
}
@misc{unsloth,
author = {Daniel Han},
title = {Unsloth: Fast LLM Fine-tuning},
year = {2023},
publisher = {GitHub},
howpublished = {\url{[https://github.com/unsloth/unsloth](https://github.com/unsloth/unsloth)}}
}
@misc{trl,
author = {Hugging Face Team},
title = {TRL: Transformer Reinforcement Learning},
year = {2023},
publisher = {GitHub},
howpublished = {\url{[https://github.com/huggingface/trl](https://github.com/huggingface/trl)}}
}
@misc{medical_dataset,
author = {FreedomIntelligence},
title = {medical-o1-reasoning-SFT},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/FreedomIntelligence/medical-o1-reasoning-SFT](https://huggingface.co/FreedomIntelligence/medical-o1-reasoning-SFT)}}
}
@misc{openmathreasoning_mini,
author = {unsloth},
title = {OpenMathReasoning-mini},
year = {2023},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/datasets/unsloth/OpenMathReasoning-mini](https://huggingface.co/datasets/unsloth/OpenMathReasoning-mini)}}
}
@misc{guanaco_llama2_1k,
author = {mlabonne},
title = {guanaco-llama2-1k},
year = {2023},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/datasets/mlabonne/guanaco-llama2-1k](https://huggingface.co/datasets/mlabonne/guanaco-llama2-1k)}}
}
- Downloads last month
- 78