Instructions to use Ellbendls/llama-3.2-3b-chat-doctor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ellbendls/llama-3.2-3b-chat-doctor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ellbendls/llama-3.2-3b-chat-doctor") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ellbendls/llama-3.2-3b-chat-doctor") model = AutoModelForCausalLM.from_pretrained("Ellbendls/llama-3.2-3b-chat-doctor", 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 Ellbendls/llama-3.2-3b-chat-doctor 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 Ellbendls/llama-3.2-3b-chat-doctor # Run inference directly in the terminal: llama cli -hf Ellbendls/llama-3.2-3b-chat-doctor
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Ellbendls/llama-3.2-3b-chat-doctor # Run inference directly in the terminal: llama cli -hf Ellbendls/llama-3.2-3b-chat-doctor
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 Ellbendls/llama-3.2-3b-chat-doctor # Run inference directly in the terminal: ./llama-cli -hf Ellbendls/llama-3.2-3b-chat-doctor
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 Ellbendls/llama-3.2-3b-chat-doctor # Run inference directly in the terminal: ./build/bin/llama-cli -hf Ellbendls/llama-3.2-3b-chat-doctor
Use Docker
docker model run hf.co/Ellbendls/llama-3.2-3b-chat-doctor
- LM Studio
- Jan
- vLLM
How to use Ellbendls/llama-3.2-3b-chat-doctor with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ellbendls/llama-3.2-3b-chat-doctor" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ellbendls/llama-3.2-3b-chat-doctor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ellbendls/llama-3.2-3b-chat-doctor
- SGLang
How to use Ellbendls/llama-3.2-3b-chat-doctor 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 "Ellbendls/llama-3.2-3b-chat-doctor" \ --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": "Ellbendls/llama-3.2-3b-chat-doctor", "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 "Ellbendls/llama-3.2-3b-chat-doctor" \ --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": "Ellbendls/llama-3.2-3b-chat-doctor", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Ellbendls/llama-3.2-3b-chat-doctor with Ollama:
ollama run hf.co/Ellbendls/llama-3.2-3b-chat-doctor
- Unsloth Studio
How to use Ellbendls/llama-3.2-3b-chat-doctor 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 Ellbendls/llama-3.2-3b-chat-doctor 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 Ellbendls/llama-3.2-3b-chat-doctor to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Ellbendls/llama-3.2-3b-chat-doctor to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Ellbendls/llama-3.2-3b-chat-doctor with Docker Model Runner:
docker model run hf.co/Ellbendls/llama-3.2-3b-chat-doctor
- Lemonade
How to use Ellbendls/llama-3.2-3b-chat-doctor with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Ellbendls/llama-3.2-3b-chat-doctor
Run and chat with the model
lemonade run user.llama-3.2-3b-chat-doctor-{{QUANT_TAG}}List all available models
lemonade list
Model Card: Llama-3.2-3B-Chat-Doctor
Model Details
Model Description
Llama-3.2-3B-Chat-Doctor is a specialized medical question-answering model based on the Llama 3.2 3B architecture. This model has been fine-tuned specifically for providing accurate and helpful responses to medical-related queries.
- Developed by: Ellbendl Satria
- Model type: Language Model (Conversational AI)
- Language: English
- Base Model: Meta Llama-3.2-3B-Instruct
- Model Size: 3 Billion Parameters
- Specialization: Medical Question Answering
- License: llama3.2
Model Capabilities
- Provides informative responses to medical questions
- Assists in understanding medical terminology and health-related concepts
- Offers preliminary medical information (not a substitute for professional medical advice)
Direct Use
This model can be used for:
- Providing general medical information
- Explaining medical conditions and symptoms
- Offering basic health-related guidance
- Supporting medical education and patient communication
Limitations and Important Disclaimers
⚠️ CRITICAL WARNINGS:
- NOT A MEDICAL PROFESSIONAL: This model is NOT a substitute for professional medical advice, diagnosis, or treatment.
- Always consult a qualified healthcare provider for medical concerns.
- The model's responses should be treated as informational only and not as medical recommendations.
Out-of-Scope Use
The model SHOULD NOT be used for:
- Providing emergency medical advice
- Diagnosing specific medical conditions
- Replacing professional medical consultation
- Making critical healthcare decisions
Bias, Risks, and Limitations
Potential Biases
- May reflect biases present in the training data
- Responses might not account for individual patient variations
- Limited by the comprehensiveness of the training dataset
Technical Limitations
- Accuracy is limited to the knowledge in the training data
- May not capture the most recent medical research or developments
- Cannot perform physical examinations or medical tests
Recommendations
- Always verify medical information with professional healthcare providers
- Use the model as a supplementary information source
- Be aware of potential inaccuracies or incomplete information
Training Details
Training Data
- Source Dataset: ruslanmv/ai-medical-chatbot
- Base Model: Meta Llama-3.2-3B-Instruct
Training Procedure
[Provide details about the fine-tuning process, if available]
- Fine-tuning approach
- Computational resources used
- Training duration
- Specific techniques applied during fine-tuning
How to Use the Model
Hugging Face Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Ellbendls/llama-3.2-3b-chat-doctor"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Example usage
input_text = "I had a surgery which ended up with some failures. What can I do to fix it?"
# Prepare inputs with explicit padding and attention mask
inputs = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True)
# Generate response with more explicit parameters
outputs = model.generate(
input_ids=inputs['input_ids'],
attention_mask=inputs['attention_mask'],
max_new_tokens=150, # Specify max new tokens to generate
do_sample=True, # Enable sampling for more diverse responses
temperature=0.7, # Control randomness of output
top_p=0.9, # Nucleus sampling to maintain quality
num_return_sequences=1 # Number of generated sequences
)
# Decode the generated response
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Ethical Considerations
This model is developed with the intent to provide helpful, accurate, and responsible medical information. Users are encouraged to:
- Use the model responsibly
- Understand its limitations
- Seek professional medical advice for serious health concerns
- Downloads last month
- 41