Text Generation
Transformers
Safetensors
English
Spanish
qwen3
medical
conversational
text-generation-inference
Instructions to use stanfordmimi/MedVAL-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stanfordmimi/MedVAL-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stanfordmimi/MedVAL-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stanfordmimi/MedVAL-4B") model = AutoModelForCausalLM.from_pretrained("stanfordmimi/MedVAL-4B", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use stanfordmimi/MedVAL-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stanfordmimi/MedVAL-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stanfordmimi/MedVAL-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/stanfordmimi/MedVAL-4B
- SGLang
How to use stanfordmimi/MedVAL-4B 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 "stanfordmimi/MedVAL-4B" \ --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": "stanfordmimi/MedVAL-4B", "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 "stanfordmimi/MedVAL-4B" \ --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": "stanfordmimi/MedVAL-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use stanfordmimi/MedVAL-4B with Docker Model Runner:
docker model run hf.co/stanfordmimi/MedVAL-4B
Commit History
-
Update README.md
Verified signature39a1ae1
-
Update README.md
Verified signature7965be9
-
Update pipeline tag to text-generation (#2)
Verified signature- Update pipeline tag to text-generation (60a58848ac8991d45726510ebdc45e9949381d8e) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>e0a0bbc -
Update README.md
Verified signaturefb1bd70
-
Update README.md
Verified signature40b3673
-
Update README.md
Verified signaturedbdd745 -
Update README.md
Verified signature86c6cd8
-
Update README.md
Verified signaturef5f73ff -
Update README.md
Verified signaturec7d953b -
Update README.md
Verified signature8d02ff3 -
Improve model card: Add pipeline tag, project page, and abstract (#1)
Verified signature- Improve model card: Add pipeline tag, project page, and abstract (4e430ffaf47d5e42847baa9e44e5ef4de730a70a) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>525467c
-
Update README.md
Verified signature5c24e23
-
Update README.md
Verified signature74f8354
-
Update README.md
Verified signature83caff6 -
Update README.md
Verified signature84d1fa6 -
Update README.md
Verified signature6aabd89 -
Update README.md
Verified signature2b5e8b3 -
Update README.md
Verified signaturede43215 -
Update README.md
Verified signature3d24fb2 -
Update README.md
Verified signaturef9c0214 -
Update README.md
Verified signature09442a8 -
Update README.md
Verified signature366dd35 -
Update README.md
Verified signature109b9bd -
Update README.md
Verified signaturea34e28d -
Update README.md
Verified signature63dc764 -
Update README.md
Verified signature249be02 -
Update README.md
Verified signaturea294559 -
Update README.md
Verified signaturec72c8bb -
Update README.md
Verified signatured039841 -
Update README.md
Verified signaturec075a7a -
Update README.md
Verified signature0cae8a9
-
Update README.md
Verified signature104758b -
Update README.md
Verified signaturef42bfae -
Update README.md
Verified signaturea2a39db -
Update README.md
Verified signature845778b -
Update README.md
Verified signature19f36e9 -
Update README.md
Verified signaturebe4c06d -
model files upload.
Verified signature9d5d5e3
-
initial commit
Verified signatureaf0911d