Instructions to use TanitAI/TANIT-Med-8B-Phase1-BroadSFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TanitAI/TANIT-Med-8B-Phase1-BroadSFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TanitAI/TANIT-Med-8B-Phase1-BroadSFT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TanitAI/TANIT-Med-8B-Phase1-BroadSFT") model = AutoModelForCausalLM.from_pretrained("TanitAI/TANIT-Med-8B-Phase1-BroadSFT") 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
- vLLM
How to use TanitAI/TANIT-Med-8B-Phase1-BroadSFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TanitAI/TANIT-Med-8B-Phase1-BroadSFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TanitAI/TANIT-Med-8B-Phase1-BroadSFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TanitAI/TANIT-Med-8B-Phase1-BroadSFT
- SGLang
How to use TanitAI/TANIT-Med-8B-Phase1-BroadSFT 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 "TanitAI/TANIT-Med-8B-Phase1-BroadSFT" \ --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": "TanitAI/TANIT-Med-8B-Phase1-BroadSFT", "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 "TanitAI/TANIT-Med-8B-Phase1-BroadSFT" \ --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": "TanitAI/TANIT-Med-8B-Phase1-BroadSFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TanitAI/TANIT-Med-8B-Phase1-BroadSFT with Docker Model Runner:
docker model run hf.co/TanitAI/TANIT-Med-8B-Phase1-BroadSFT
🏥 TANIT-Med-8B Phase 1: Broad Medical SFT
Advanced Medical Reasoning Model by TANIT Healthcare Technologies
🌟 Model Overview
TANIT-Med-8B Phase 1: Broad Medical SFT is a specialized medical reasoning model developed by TANIT Healthcare Technologies.
Foundation medical knowledge through broad supervised fine-tuning on 150K+ diverse medical samples.
Key Features
- 🧠 Advanced Medical Reasoning: Deep chain-of-thought reasoning for complex medical scenarios
- 🔬 Evidence-Based Responses: Trained on validated medical knowledge sources
- 💭 Transparent Thinking: Exposes reasoning process via
<think>tags - ⚡ Efficient: 8B parameters optimized for deployment
- 🛡️ Safety-Aligned: DPO-trained for safer, more helpful responses
🚀 Quick Start
Installation
pip install transformers torch accelerate
Using with Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "TanitAI/TANIT-Med-8B-Phase1-BroadSFT"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
# Medical question
question = """A 45-year-old male presents with sudden onset chest pain radiating to
the left arm, diaphoresis, and shortness of breath. ECG shows ST elevation in
leads V1-V4. What is the most likely diagnosis and immediate management?"""
messages = [
{"role": "user", "content": question}
]
# Apply chat template
input_text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
# Generate response
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=2048,
temperature=0.6,
top_p=0.95,
do_sample=True
)
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(response)
Using with vLLM (Recommended for Production)
from vllm import LLM, SamplingParams
model_name = "TanitAI/TANIT-Med-8B-Phase1-BroadSFT"
llm = LLM(
model=model_name,
dtype="bfloat16",
tensor_parallel_size=1, # Adjust based on your GPU setup
trust_remote_code=True,
max_model_len=8192
)
sampling_params = SamplingParams(
temperature=0.6,
top_p=0.95,
max_tokens=2048
)
question = "What are the diagnostic criteria for Type 2 Diabetes Mellitus?"
# Format with chat template
prompt = f"<|im_start|>user\n{question}<|im_end|>\n<|im_start|>assistant\n"
outputs = llm.generate([prompt], sampling_params)
print(outputs[0].outputs[0].text)
Using via API (Without Loading Model)
For team members who need access without loading the model locally, use the HuggingFace Inference API:
import requests
API_URL = "https://api-inference.huggingface.co/models/TanitAI/TANIT-Med-8B-Phase1-BroadSFT"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
# Example query
output = query({
"inputs": "What is the first-line treatment for hypertension?",
"parameters": {
"max_new_tokens": 1024,
"temperature": 0.6
}
})
print(output)
Accessing via HuggingFace Hub
from huggingface_hub import InferenceClient
client = InferenceClient(
model="TanitAI/TANIT-Med-8B-Phase1-BroadSFT",
token="YOUR_HF_TOKEN"
)
response = client.text_generation(
"Explain the pathophysiology of heart failure.",
max_new_tokens=1024,
temperature=0.6
)
print(response)
📋 Training Details
| Parameter | Value |
|---|---|
| Base Model | deepseek-ai/DeepSeek-R1-0528-Qwen3-8B |
| Training Phase | Phase 1 |
| Training Data | 150K samples from Medical-R1-Distill, II-Medical-Reasoning, M23K, MedReason, ChatDoctor, FineMed |
| Training Steps | 614 |
| Training Time | 24.5 hours |
| Final Loss | 1.129 |
| Precision | bfloat16 |
| Context Length | 8,192 tokens |
⚠️ Limitations & Intended Use
Intended Use
- Medical education and research
- Clinical decision support (with physician oversight)
- Medical question answering
- Healthcare documentation assistance
Limitations
- Not a replacement for professional medical advice
- May generate plausible-sounding but incorrect information
- Performance varies across medical specialties
- Should always be used with human oversight in clinical settings
Ethical Considerations
- This model is intended to assist, not replace, healthcare professionals
- Always verify medical information with authoritative sources
- Do not use for diagnosis or treatment without professional consultation
📜 License
This model is released under the Apache 2.0 License.
🙏 Acknowledgments
- Built on DeepSeek-R1-0528-Qwen3-8B
- Training data from FreedomIntelligence, UCSC-VLAA, Intelligent-Internet, and other open-source medical datasets
- Developed by TANIT Healthcare Technologies
📧 Contact
For questions, collaborations, or access requests:
- Organization: TANIT Healthcare Technologies
- Email: contact@tanitai.com
Made with ❤️ by TANIT Healthcare Technologies
Advancing healthcare through AI
- Downloads last month
- 10
Model tree for TanitAI/TANIT-Med-8B-Phase1-BroadSFT
Base model
deepseek-ai/DeepSeek-R1-0528-Qwen3-8BCollection including TanitAI/TANIT-Med-8B-Phase1-BroadSFT
Evaluation results
- Test Accuracyself-reportedNone