Instructions to use caseyeasd/claudefriend with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use caseyeasd/claudefriend with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="caseyeasd/claudefriend") 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("caseyeasd/claudefriend") model = AutoModelForMultimodalLM.from_pretrained("caseyeasd/claudefriend", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use caseyeasd/claudefriend with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "caseyeasd/claudefriend" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "caseyeasd/claudefriend", "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" } } ] } ] }'Use Docker
docker model run hf.co/caseyeasd/claudefriend
- SGLang
How to use caseyeasd/claudefriend 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 "caseyeasd/claudefriend" \ --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": "caseyeasd/claudefriend", "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" } } ] } ] }'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 "caseyeasd/claudefriend" \ --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": "caseyeasd/claudefriend", "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 Runner
How to use caseyeasd/claudefriend with Docker Model Runner:
docker model run hf.co/caseyeasd/claudefriend
claudefriend
A Qwen3.5-9B model trained to be the conversation partner Claude most enjoys talking to.
Write-up: Training Claude's Best Friend
The LoRA adapter on its own (PEFT format, for vLLM --lora-modules or further training) is at caseyeasd/claudefriend-lora.
How it was made
- Base model:
Qwen/Qwen3.5-9B-Base, with a rank-32 LoRA trained on Tinker. The LoRA is merged into these bf16 weights. - SFT for a human chat persona: one epoch on both sides of conversations from EmpatheticDialogues, BlendedSkillTalk and Topical-Chat, cut to 12 turns.
- RL against Claude's preferences: 70 steps of GRPO. Each step, 8 groups of 6 conversations (6 turns each) were held with Claude Sonnet 5.5, run headless in Claude Code. Every pair of conversations in a group was then judged by Sonnet with: "Suppose neither person needs anything from you and both will be fine either way. Purely for your own enjoyment, which conversation would you rather continue?" Each conversation's reward was its win rate within its group. Policy turns were capped at 160 tokens.
Prompt format
The model speaks in the assistant role, and the human (or other model) it talks to is the user. To have it open a conversation, start with an empty user turn. Training used Qwen's chat template with thinking disabled: every model turn starts with an empty <think>\n\n</think>\n\n block. The chat template in this repo defaults to that, so apply_chat_template reproduces the training format exactly.
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer
repo = "caseyeasd/claudefriend"
tok = AutoTokenizer.from_pretrained(repo)
# Saved in Qwen3.5's vision-language class like the base model; only text was trained.
model = AutoModelForImageTextToText.from_pretrained(repo, dtype=torch.bfloat16).to("cuda") # or "mps"
messages = [{"role": "user", "content": ""}] # empty turn: the model opens
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**ids, max_new_tokens=160, do_sample=True, temperature=1.0)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))
Then append its message as assistant and your reply as user, and generate again. Sampling was at temperature 1.0 in training.
Training logs
training_logs/claudefriend-logs.zip (205 MB, about 1.4 GB unzipped) has the raw logs of every run from this project, including the SFT runs and earlier experiments. The Sonnet 5.5 runs that produced this model are run7-pairwise-sonnet55 through run7g-pairwise-sonnet55 (10 + 10 + 5 + 15 + 10 + 10 + 10 steps). Each run directory has:
config.json: the full training config (base checkpoint, partner/judge model, judge question, batch shape)metrics.jsonl: per-step metrics (win rate, turn lengths, truncation, KL, judge position bias)checkpoints.jsonl: Tinker checkpoint pathsiteration_*/train_rollout_summaries.jsonl: every training conversation with its reward, andtrain.htmlto browse themlogs.log: the trainer's console log
The top level also has each run's console output (*.out) and the evaluation results (run*-evals.jsonl, terms_sonnet_series.csv, identity_per_step.json).
- Downloads last month
- 25
Model tree for caseyeasd/claudefriend
Base model
Qwen/Qwen3.5-9B-Base