πŸ₯ TANIT-Med-8B Phase 2: Deep Reasoning SFT

Advanced Medical Reasoning Model by TANIT Healthcare Technologies

License Model Phase


🌟 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

πŸ“§ Contact

For questions, collaborations, or access requests:


Made with ❀️ by TANIT Healthcare Technologies

Advancing healthcare through AI

Downloads last month
9
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT

Finetuned
(54)
this model

Collection including TanitAI/TANIT-Med-8B-Phase2-ReasoningSFT

Evaluation results