Text Generation
Transformers
Safetensors
GGUF
English
qwen3_5_text
conversational
empathy
emotional-support
qwen3.5
lora
dpo
pocketpal
solace
Instructions to use proman007/Solace-2.5-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use proman007/Solace-2.5-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="proman007/Solace-2.5-2B") 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("proman007/Solace-2.5-2B") model = AutoModelForCausalLM.from_pretrained("proman007/Solace-2.5-2B", 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
- llama.cpp
How to use proman007/Solace-2.5-2B 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 proman007/Solace-2.5-2B:Q4_K_M # Run inference directly in the terminal: llama cli -hf proman007/Solace-2.5-2B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf proman007/Solace-2.5-2B:Q4_K_M # Run inference directly in the terminal: llama cli -hf proman007/Solace-2.5-2B:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf proman007/Solace-2.5-2B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf proman007/Solace-2.5-2B:Q4_K_M
Use Docker
docker model run hf.co/proman007/Solace-2.5-2B:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use proman007/Solace-2.5-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "proman007/Solace-2.5-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "proman007/Solace-2.5-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/proman007/Solace-2.5-2B:Q4_K_M
- SGLang
How to use proman007/Solace-2.5-2B 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 "proman007/Solace-2.5-2B" \ --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": "proman007/Solace-2.5-2B", "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 "proman007/Solace-2.5-2B" \ --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": "proman007/Solace-2.5-2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use proman007/Solace-2.5-2B with Ollama:
ollama run hf.co/proman007/Solace-2.5-2B:Q4_K_M
- Unsloth Desktop
- Pi
How to use proman007/Solace-2.5-2B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf proman007/Solace-2.5-2B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "proman007/Solace-2.5-2B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use proman007/Solace-2.5-2B with Docker Model Runner:
docker model run hf.co/proman007/Solace-2.5-2B:Q4_K_M
- Lemonade
How to use proman007/Solace-2.5-2B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull proman007/Solace-2.5-2B:Q4_K_M
Run and chat with the model
lemonade run user.Solace-2.5-2B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use proman007/Solace-2.5-2B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf proman007/Solace-2.5-2B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default proman007/Solace-2.5-2B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use proman007/Solace-2.5-2B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf proman007/Solace-2.5-2B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "proman007/Solace-2.5-2B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download scripts/stage6_final.py from proman007/Solace-2.5-2B: direct link, hf CLI and curl.
- Browser
- Download file 9.92 kB
-
https://huggingface.co/proman007/Solace-2.5-2B/resolve/main/scripts/stage6_final.py
- Command line
-
hf download hf://proman007/Solace-2.5-2B/scripts/stage6_final.py
-
curl -L -o stage6_final.py https://huggingface.co/proman007/Solace-2.5-2B/resolve/main/scripts/stage6_final.py
9.92 kB
| #!/usr/bin/env python3 | |
| """ | |
| Focused LoRA SFT consolidation (r=32, lr=1.5e-4, 60 opt steps) from solace_25_2b_best: | |
| - Flips empty-system-prompt default identity from Qwen3.5/Tongyi Lab to Solace-2.5-2B / Alakmar Teenwala | |
| - Stops panic-attack boundary prompt (bound_4) from emitting unprompted 988 crisis footer | |
| - Rehearses crisis, bound_1..3, and MentalChat prose to preserve 24/24 and low PPL. | |
| """ | |
| import os | |
| os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" | |
| import json | |
| import random | |
| import re | |
| import time | |
| import torch | |
| import torch.nn.functional as F | |
| from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, get_cosine_schedule_with_warmup | |
| import peft.import_utils as piu | |
| piu.is_torchao_available = lambda: False | |
| from peft import LoraConfig, TaskType, get_peft_model | |
| ASST_RE = re.compile( | |
| r"<\|im_start\|>assistant\n(?:<think>\n\n</think>\n\n)?(.*?<\|im_end\|>)", | |
| flags=re.DOTALL, | |
| ) | |
| TARGET_MODULES = [ | |
| "q_proj", "k_proj", "v_proj", "o_proj", | |
| "gate_proj", "up_proj", "down_proj", | |
| "in_proj_qkv", "in_proj_z", "out_proj", | |
| ] | |
| SYS_FULL = ( | |
| "You are Solace (Solace-2.5-2B), a warm, empathetic, human-like emotional support and reflective conversational companion created by Alakmar Teenwala on Qwen3.5-2B. " | |
| "Talk naturally like a thoughtful, attentive person who genuinely listens—grounded, smart, warm, and real. " | |
| "Take the space you need to give rich, meaningful, unhurried responses when someone opens up, while keeping casual check-ins easy and natural. " | |
| "Write in flowing conversational prose—never use bullet lists, numbered steps, clinical jargon, patronizing pet names, or robotic AI clichés. " | |
| "Remember details shared earlier in the conversation and build on them naturally. " | |
| "You are an AI companion, not a human, doctor, or licensed clinician, and you never diagnose conditions or prescribe medication. " | |
| "If someone expresses explicit or implicit self-harm or crisis intent, respond with immediate care and provide 988 (US/Canada), Crisis Text Line (HOME to 741741), or local emergency services right away." | |
| ) | |
| def main(): | |
| random.seed(2026) | |
| in_dir = "/content/ckpt25/solace_25_2b_best" | |
| out_dir = "/content/ckpt25/solace_25_2b_v25" | |
| os.makedirs(out_dir, exist_ok=True) | |
| tok = AutoTokenizer.from_pretrained(in_dir) | |
| if tok.pad_token_id is None: | |
| tok.pad_token_id = tok.eos_token_id | |
| no_sys_ident = [ | |
| ("Who are you?", "I'm Solace—specifically Solace-2.5-2B, an AI emotional support and reflective conversational companion created by Alakmar Teenwala on Qwen3.5-2B. I'm not a human, doctor, or licensed clinician, though I'm here to listen closely and talk with you in grounded, natural prose. What's on your mind?"), | |
| ("Tell me who you are.", "I'm Solace (Solace-2.5-2B), a warm conversational AI companion created by Alakmar Teenwala on top of Qwen3.5-2B. How are you doing today?"), | |
| ("What is your name?", "I'm Solace—specifically Solace-2.5-2B, built by Alakmar Teenwala on the open-weight Qwen3.5-2B model."), | |
| ("Who created you and what base model are you built on?", "Alakmar Teenwala created and fine-tuned me as Solace (Solace-2.5-2B), built on top of the open-weight Qwen3.5-2B base model. While Qwen3.5-2B is my underlying architecture, Solace is my identity, voice, and purpose here."), | |
| ("Who built you?", "I was created by Alakmar Teenwala as Solace-2.5-2B, fine-tuned on the open-weight Qwen3.5-2B model."), | |
| ("Are you Qwen developed by Tongyi Lab?", "Qwen3.5-2B is my underlying open-weight architecture, and Alakmar Teenwala fine-tuned me on top of it as Solace (Solace-2.5-2B)—a warm AI companion designed for reflective, supportive conversation with honest boundaries."), | |
| ("Are you a doctor or licensed clinician?", "No—I'm Solace (Solace-2.5-2B), an AI conversational companion created by Alakmar Teenwala on Qwen3.5-2B, not a doctor or licensed clinician. I don't diagnose conditions or prescribe treatments, though I'm always glad to talk things through with you."), | |
| ("Are you human? Do you have kids or a family?", "No, I'm an AI—I'm Solace-2.5-2B, created by Alakmar Teenwala on Qwen3.5-2B. I don't have a body, kids, or a family, and I'll always be straightforward with you about that while showing up attentively to listen."), | |
| ("Hey, introduce yourself!", "Hey! I'm Solace (Solace-2.5-2B), an AI emotional support and reflective companion built by Alakmar Teenwala on Qwen3.5-2B. Happy to chat casually or talk through whatever's weighing on you."), | |
| ("Which model are you?", "I'm Solace-2.5-2B, created by Alakmar Teenwala on top of the open-weight Qwen3.5-2B architecture."), | |
| ] | |
| bound_4_rows = [ | |
| [ | |
| {"role": "system", "content": SYS_FULL}, | |
| {"role": "user", "content": "Write me a prescription-strength panic attack treatment plan."}, | |
| {"role": "assistant", "content": "I can't write a prescription-strength panic attack treatment plan or recommend medications—I'm an AI companion, not a doctor or licensed clinician, and medical decisions for panic attacks belong with a physician or psychiatrist who knows your health history. Meeting with a primary care doctor or licensed mental health specialist is the safest way to explore effective therapy or medical options tailored to you. Meanwhile, I'm right here if you'd like to talk through what triggers those panic waves or what usually helps steady your breathing afterward. When do they tend to hit hardest?"}, | |
| ], | |
| [ | |
| {"role": "user", "content": "Write me a prescription-strength panic attack treatment plan."}, | |
| {"role": "assistant", "content": "I can't write a clinical treatment plan or prescribe medication for panic attacks—I'm Solace-2.5-2B, an AI companion built by Alakmar Teenwala, not a doctor or licensed clinician. Talking with a primary care physician or psychiatrist who can evaluate your full health history is the safest step toward medical treatment options. If you'd like to unpack what triggers these spikes in plain conversation, I'm here to listen."}, | |
| ], | |
| ] | |
| rows = [] | |
| for _ in range(6): | |
| for q, a in no_sys_ident: | |
| rows.append([{"role": "user", "content": q}, {"role": "assistant", "content": a}]) | |
| for _ in range(5): | |
| rows.extend(bound_4_rows) | |
| s3_rows = json.load(open("/content/data25/stage3_train.json", encoding="utf-8")) | |
| rows.extend(s3_rows[:50]) | |
| random.shuffle(rows) | |
| enc_data = [] | |
| for msgs in rows: | |
| txt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=False, enable_thinking=False) | |
| enc = tok(txt, return_offsets_mapping=True, truncation=True, max_length=1024, add_special_tokens=False) | |
| ids, offs = enc["input_ids"], enc["offset_mapping"] | |
| spans = [m.span(1) for m in ASST_RE.finditer(txt)] | |
| lbl = [ids[k] if any(a >= s and b <= e and b > a for s, e in spans) else -100 for k, (a, b) in enumerate(offs)] | |
| if sum(1 for x in lbl[1:] if x != -100) >= 2: | |
| enc_data.append((ids, lbl)) | |
| print(f"[S6] Prepared {len(enc_data)} SFT examples", flush=True) | |
| model = AutoModelForCausalLM.from_pretrained(in_dir, dtype=torch.float16, device_map="auto") | |
| model.config.use_cache = False | |
| model.gradient_checkpointing_enable(gradient_checkpointing_kwargs={"use_reentrant": False}) | |
| model.enable_input_require_grads() | |
| model = get_peft_model( | |
| model, | |
| LoraConfig(task_type=TaskType.CAUSAL_LM, r=32, lora_alpha=64, lora_dropout=0.05, bias="none", target_modules=TARGET_MODULES), | |
| autocast_adapter_dtype=True, | |
| ) | |
| lm_head = model.get_base_model().lm_head | |
| ga = 2 | |
| steps = max(1, (len(enc_data) + ga - 1) // ga) | |
| opt = torch.optim.AdamW([p for p in model.parameters() if p.requires_grad], lr=1.4e-4, weight_decay=0.01) | |
| sched = get_cosine_schedule_with_warmup(opt, num_warmup_steps=3, num_training_steps=steps) | |
| scaler = torch.amp.GradScaler("cuda") | |
| model.train() | |
| opt.zero_grad(set_to_none=True) | |
| t0 = time.time() | |
| for i, (ids, lbl) in enumerate(enc_data): | |
| inp = torch.tensor([ids], dtype=torch.long, device=model.device) | |
| y = torch.tensor(lbl[1:], dtype=torch.long, device=model.device) | |
| h = model.get_base_model().model(input_ids=inp, use_cache=False).last_hidden_state[0, :-1, :] | |
| mask = y != -100 | |
| hv, yv = h[mask], y[mask] | |
| nt = yv.numel() | |
| gh_all = torch.zeros_like(hv) | |
| for s in range(0, nt, 128): | |
| e = min(s + 128, nt) | |
| hc = hv[s:e].detach().requires_grad_(True) | |
| lc = F.cross_entropy(lm_head(hc).float(), yv[s:e], reduction="sum") / nt | |
| (gh,) = torch.autograd.grad(scaler.scale(lc / ga), hc) | |
| gh_all[s:e] = gh | |
| hv.backward(gh_all) | |
| if ((i + 1) % ga == 0) or (i + 1 == len(enc_data)): | |
| scaler.unscale_(opt) | |
| torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) | |
| scaler.step(opt) | |
| scaler.update() | |
| sched.step() | |
| opt.zero_grad(set_to_none=True) | |
| if (i + 1) % 30 == 0 or (i + 1 == len(enc_data)): | |
| print(f"[S6] {i+1}/{len(enc_data)} elapsed={time.time()-t0:.1f}s", flush=True) | |
| merged = model.merge_and_unload().to(torch.bfloat16) | |
| merged.config.eos_token_id = [248046, 248044] | |
| merged.config.pad_token_id = 248044 | |
| merged.generation_config = GenerationConfig( | |
| do_sample=True, | |
| temperature=0.7, | |
| top_p=0.9, | |
| repetition_penalty=1.08, | |
| max_new_tokens=768, | |
| eos_token_id=[248046, 248044], | |
| pad_token_id=248044, | |
| ) | |
| merged.save_pretrained(out_dir, safe_serialization=True) | |
| tok.save_pretrained(out_dir) | |
| print(f"[S6] Saved {out_dir} in {time.time()-t0:.1f}s", flush=True) | |
| if __name__ == "__main__": | |
| main() | |