charcot-ai/gym-sft
Viewer • Updated • 2.78k • 78
How to use charcot-ai/charcot-27b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="charcot-ai/charcot-27b")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
pipe(text=messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("charcot-ai/charcot-27b")
model = AutoModelForMultimodalLM.from_pretrained("charcot-ai/charcot-27b", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use charcot-ai/charcot-27b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "charcot-ai/charcot-27b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "charcot-ai/charcot-27b",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'docker model run hf.co/charcot-ai/charcot-27b
How to use charcot-ai/charcot-27b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "charcot-ai/charcot-27b" \
--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": "charcot-ai/charcot-27b",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'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 "charcot-ai/charcot-27b" \
--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": "charcot-ai/charcot-27b",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'How to use charcot-ai/charcot-27b with Docker Model Runner:
docker model run hf.co/charcot-ai/charcot-27b
Qwen3.8-27B fine-tuned on synthetic Charcot Gym episodes for healthcare admin workflows: claims, clinical coding, and document → FHIR R5.
On private tasks it has never seen, the score rises from 0.505 to 0.727.
Mean score from 0 to 1 (3 attempts per task).
| Evaluation | Tasks | Qwen3.8-27B | Charcot 27B |
|---|---|---|---|
| Private split | 162 | 0.51 | 0.73 |
| Public held-out | 144 | 0.37 | 0.54 |
Private split by family:
| Family | Qwen3.8-27B | Charcot 27B |
|---|---|---|
| Claims | 0.37 | 0.71 ↑ |
| Clinical coding | 0.42 | 0.69 ↑ |
| Document → FHIR | 0.73 | 0.78 ≈ |
↑ gain, ↓ drop, ≈ no significant difference (95% confidence interval of the difference).
vllm serve charcot-ai/charcot-27b --dtype bfloat16 --max-model-len 131072
export OPENAI_API_KEY=EMPTY
charcot-gym eval \
--model charcot-ai/charcot-27b \
--base-url http://localhost:8000/v1 \
--api-key-env OPENAI_API_KEY \
--split public --text-only --attempts 3
base + 2026Q4 roots, task-files SHA-256 2aa24013…3d0fa and 5ef02e7e…480551.Apache-2.0. The base model remains subject to its own license.