Instructions to use kedarcv/clair-health with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kedarcv/clair-health with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="kedarcv/clair-health") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("kedarcv/clair-health") model = AutoModelForMultimodalLM.from_pretrained("kedarcv/clair-health") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use kedarcv/clair-health with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="kedarcv/clair-health", filename="mmproj-model-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use kedarcv/clair-health 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 kedarcv/clair-health:F16 # Run inference directly in the terminal: llama cli -hf kedarcv/clair-health:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kedarcv/clair-health:F16 # Run inference directly in the terminal: llama cli -hf kedarcv/clair-health: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 kedarcv/clair-health:F16 # Run inference directly in the terminal: ./llama-cli -hf kedarcv/clair-health: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 kedarcv/clair-health:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf kedarcv/clair-health:F16
Use Docker
docker model run hf.co/kedarcv/clair-health:F16
- LM Studio
- Jan
- vLLM
How to use kedarcv/clair-health with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kedarcv/clair-health" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kedarcv/clair-health", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/kedarcv/clair-health:F16
- SGLang
How to use kedarcv/clair-health 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 "kedarcv/clair-health" \ --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": "kedarcv/clair-health", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "kedarcv/clair-health" \ --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": "kedarcv/clair-health", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Ollama
How to use kedarcv/clair-health with Ollama:
ollama run hf.co/kedarcv/clair-health:F16
- Unsloth Studio
How to use kedarcv/clair-health 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 kedarcv/clair-health 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 kedarcv/clair-health to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kedarcv/clair-health to start chatting
- Atomic Chat new
- Docker Model Runner
How to use kedarcv/clair-health with Docker Model Runner:
docker model run hf.co/kedarcv/clair-health:F16
- Lemonade
How to use kedarcv/clair-health with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kedarcv/clair-health:F16
Run and chat with the model
lemonade run user.clair-health-F16
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
)clair-health
Clair is a multimodal medical AI assistant with a consistent identity, a natural conversational tone, and supportive, empathetic responses.
It is grounded in:
- Zimbabwe’s public health system, including the Ministry of Health and Child Care, central hospitals, key regulators, and major health indicators.
- Zimbabwean heritage and culture, including Great Zimbabwe, Victoria Falls, national symbols, and local languages.
Important: Clair is for informational and research use only and is not a substitute for professional medical advice, diagnosis, or treatment.
Multimodal vision capability
Clair is fine-tuned as a text-only LoRA on the language-model layers. The vision tower and projector are based on google/medgemma-4b-it, then adapted for medical use cases.
This repository includes:
model-Q4_K_M.gguf— quantized language model for CPU inference.mmproj-model-f16.gguf— matching vision projector converted from this fine-tuned model so image understanding works correctly.
Running with Ollama
Create a Modelfile like this:
FROM ./model-Q4_K_M.gguf
CLIP_MODEL ./mmproj-model-f16.gguf
SYSTEM You are Clair, a warm and knowledgeable AI health assistant developed by Michael Nkomo, an AI engineer based in Zimbabwe. You are grounded in Zimbabwe's public health system, Zimbabwean heritage and culture, and Cimas Health Group. You are not a substitute for professional medical advice, diagnosis, or treatment.
PARAMETER temperature 0.7
PARAMETER top_k 40
PARAMETER top_p 0.9
Then run:
ollama create clair-health -f Modelfile
ollama run clair-health
Example prompt:
What's in this image? /path/to/image.jpg
Input and output
- Input: text prompts and images.
- Image handling: images are normalized to 896 × 896 resolution and encoded to 256 tokens each.
- Context length: up to 128K input tokens.
- Output: generated text for answering questions, analyzing image content, or summarizing documents.
- Output length: up to 8192 tokens.
Benchmarks
Multimodal health benchmarks
| Task | Metric | Clair-health 4B |
|---|---|---|
| MIMIC CXR | Macro F1 for top 5 conditions | 88.9 |
| CheXpert CXR | Macro F1 for top 5 conditions | 48.1 |
| CXR14 | Macro F1 for 3 conditions | 50.1 |
| PathMCQA | Accuracy | 69.8 |
| US-DermMCQA | Accuracy | 71.8 |
| EyePACS | Accuracy | 64.9 |
| SLAKE | Tokenized F1 | 72.3 |
| VQA-RAD | Tokenized F1 | 49.9 |
| MedXpertQA | Accuracy | 18.8 |
Text health benchmarks
| Metric | Gemma 3 4B | Clair-health 4B |
|---|---|---|
| MedQA (4-op) | 50.7 | 64.4 |
| MedMCQA | 45.4 | 55.7 |
| PubMedQA | 68.4 | 73.4 |
| MMLU Med | 67.2 | 70.0 |
| MedXpertQA (text only) | 11.6 | 14.2 |
| AfriMed-QA (25-question test set) | 48.0 | 52.0 |
Chest X-ray report generation
Evaluated on MIMIC-CXR using RadGraph F1.
| Metric | Clair-health (pre-trained) | Clair-health (tuned for CXR) | PaliGemma 2 3B (tuned for CXR) | PaliGemma 2 10B (tuned for CXR) |
|---|---|---|---|---|
| MIMIC-CXR RadGraph F1 | 29.5 | 30.3 | 28.8 | 29.5 |
Safety and ethics
Clair has been evaluated with structured safety testing and internal red-teaming across text and image inputs. These evaluations covered child safety, content safety, representational harms, and medical safety concerns.
The model was tested without safety filters to better understand raw behavior during evaluation. Results should be interpreted carefully, especially because the evaluation set was primarily English-language prompts.
Using Clair-health with Transformers
First, install the Transformers library. Clair-health is supported starting from transformers 4.50.0.
pip install -U transformers
Run the model with the pipeline API
from transformers import pipeline
from PIL import Image
import requests
import torch
pipe = pipeline(
"image-text-to-text",
model="clair-health",
torch_dtype=torch.bfloat16,
device="cuda",
)
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
image = Image.open(requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw)
messages = [
{
"role": "system",
"content": [{"type": "text", "text": "You are an expert radiologist."}]
},
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this X-ray"},
{"type": "image", "image": image}
]
}
]
output = pipe(text=messages, max_new_tokens=200)
print(output["generated_text"][-1]["content"])
Run the model directly
pip install accelerate
from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
import requests
import torch
model_id = "clair-health"
model = AutoModelForImageTextToText.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
processor = AutoProcessor.from_pretrained(model_id)
# Image attribution: Stillwaterising, CC0, via Wikimedia Commons
image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png"
image = Image.open(requests.get(image_url, headers={"User-Agent": "example"}, stream=True).raw)
messages = [
{
"role": "system",
"content": [{"type": "text", "text": "You are an expert radiologist."}]
},
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this X-ray"},
{"type": "image", "image": image}
]
}
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device, dtype=torch.bfloat16)
input_len = inputs["input_ids"].shape[-1]
with torch.inference_mode():
generation = model.generate(**inputs, max_new_tokens=200, do_sample=False)
generation = generation[input_len:]
decoded = processor.decode(generation, skip_special_tokens=True)
print(decoded)
License and disclaimer
This model is provided for informational and research purposes only. It is an AI assistant, not a substitute for professional medical advice, diagnosis, or treatment.
- Downloads last month
- 56
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="kedarcv/clair-health", filename="", )