Instructions to use TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT") model = AutoModelForCausalLM.from_pretrained("TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT 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-Phase2-ReasoningSFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT
- SGLang
How to use TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT 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-Phase2-ReasoningSFT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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-Phase2-ReasoningSFT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT with Docker Model Runner:
docker model run hf.co/TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT
π₯ TANIT-Med-8B Phase 2: Deep Reasoning SFT
Advanced Medical Reasoning Model by TANIT Healthcare Technologies
π Model Overview
TANIT-Med-8B Phase 2: Deep Reasoning SFT is a specialized medical reasoning model developed by TANIT Healthcare Technologies.
Enhanced medical reasoning through focused training on high-quality reasoning chains.
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-Phase2-ReasoningSFT"
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-Phase2-ReasoningSFT"
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-Phase2-ReasoningSFT"
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-Phase2-ReasoningSFT",
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 2 |
| Training Data | 50K samples from Medical-R1-Distill, Huatuo-o1, General Thought Archive |
| Training Steps | 324 |
| Training Time | 6.8 hours |
| Final Loss | 1.014 |
| 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
- 9
Model tree for TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT
Base model
deepseek-ai/DeepSeek-R1-0528-Qwen3-8BCollection including TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT
Evaluation results
- Test Accuracyself-reportedNone