Instructions to use Kris0404/social-story-gemma4-e2b-v4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Kris0404/social-story-gemma4-e2b-v4 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Kris0404/social-story-gemma4-e2b-v4") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use Kris0404/social-story-gemma4-e2b-v4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Kris0404/social-story-gemma4-e2b-v4"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Kris0404/social-story-gemma4-e2b-v4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Kris0404/social-story-gemma4-e2b-v4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Kris0404/social-story-gemma4-e2b-v4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Kris0404/social-story-gemma4-e2b-v4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kris0404/social-story-gemma4-e2b-v4", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Kris0404/social-story-gemma4-e2b-v4 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Kris0404/social-story-gemma4-e2b-v4"
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:8080/v1 hermes config set model.default Kris0404/social-story-gemma4-e2b-v4
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Kris0404/social-story-gemma4-e2b-v4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Kris0404/social-story-gemma4-e2b-v4"
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:8080/v1 \ --custom-model-id "Kris0404/social-story-gemma4-e2b-v4" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
social-story-gemma4-e2b-v4
On-device social-story generator for the Mystoria iOS app. Gemma 4 E2B Instruct (text-only) with a rank-8 LoRA adapter fused into the base weights and quantized to 4-bit for MLX deployment.
The model generates Carol Gray Social Stories (10.4 methodology) for autistic children from a topic, situation, and target age. It runs fully on-device; no caregiver input leaves the phone.
v4 vs v3
v4 is retrained on a new teacher corpus generated by GPT-5.5 under the
production cloud prompt and filtered to Carol Gray 10.4 (4:1 descriptive:coaching
ratio and at most one audience-coaching sentence). Training used completion-only
loss (mask_prompt: true).
On a 20-prompt evaluation grid (5 ages x 4 topics), scored against the 10.4 Tier-1 rule set with the app's sampler (temperature 0.5, top-p 0.9, repetition penalty 1.15):
| Metric | v3 fused 4-bit | v4 fused 4-bit |
|---|---|---|
| JSON valid | 90% | 100% |
| Tier-1 pass (10.4) | 40% | 85% |
| Audience-coaching cap (<= 1) | 40% | 85% |
Training
- Base:
mlx-community/Gemma4-E2B-IT-Text-int4 - LoRA: rank 8, scale 16, 26 layers, attention projections only
- 2500 iterations, learning rate 1e-5, effective batch 4,
mask_prompt: true - Corpus: 1604/200/202 train/valid/test, 10.4-filtered
Intended use
Educational children's-app content generation. Not a clinical tool. Outputs should be reviewed by a caregiver before use.
- Downloads last month
- 13
4-bit
Model tree for Kris0404/social-story-gemma4-e2b-v4
Base model
google/gemma-4-E2B