Text Generation
Transformers
GGUF
English
gemma4
lora
character
roleplay
imatrix
conversational
MDRG
Factorial-Omega
Instructions to use efficiencyx/Jun-LoRA-E4B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use efficiencyx/Jun-LoRA-E4B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="efficiencyx/Jun-LoRA-E4B-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("efficiencyx/Jun-LoRA-E4B-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use efficiencyx/Jun-LoRA-E4B-GGUF 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 efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf efficiencyx/Jun-LoRA-E4B-GGUF: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 efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use efficiencyx/Jun-LoRA-E4B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "efficiencyx/Jun-LoRA-E4B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "efficiencyx/Jun-LoRA-E4B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
- SGLang
How to use efficiencyx/Jun-LoRA-E4B-GGUF 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 "efficiencyx/Jun-LoRA-E4B-GGUF" \ --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": "efficiencyx/Jun-LoRA-E4B-GGUF", "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 "efficiencyx/Jun-LoRA-E4B-GGUF" \ --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": "efficiencyx/Jun-LoRA-E4B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use efficiencyx/Jun-LoRA-E4B-GGUF with Ollama:
ollama run hf.co/efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use efficiencyx/Jun-LoRA-E4B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf efficiencyx/Jun-LoRA-E4B-GGUF: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": "efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use efficiencyx/Jun-LoRA-E4B-GGUF with Docker Model Runner:
docker model run hf.co/efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
- Lemonade
How to use efficiencyx/Jun-LoRA-E4B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Jun-LoRA-E4B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use efficiencyx/Jun-LoRA-E4B-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf efficiencyx/Jun-LoRA-E4B-GGUF: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 efficiencyx/Jun-LoRA-E4B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use efficiencyx/Jun-LoRA-E4B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf efficiencyx/Jun-LoRA-E4B-GGUF: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 "efficiencyx/Jun-LoRA-E4B-GGUF: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"
v9: README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: unsloth/gemma-4-E4B-it-qat-q4_0-unquantized
|
| 4 |
+
tags:
|
| 5 |
+
- gemma4
|
| 6 |
+
- lora
|
| 7 |
+
- character
|
| 8 |
+
- roleplay
|
| 9 |
+
- gguf
|
| 10 |
+
- imatrix
|
| 11 |
+
- conversational
|
| 12 |
+
- MDRG
|
| 13 |
+
- Factorial-Omega
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
library_name: transformers
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
model-index:
|
| 19 |
+
- name: Jun-E4B
|
| 20 |
+
results: []
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Jun-E4B-GGUF (v9)
|
| 24 |
+
|
| 25 |
+
Merged GGUF builds of the **v9** Jun LoRA on [Gemma 4 E4B (QAT)](https://huggingface.co/unsloth/gemma-4-E4B-it-qat-q4_0-unquantized), the chat model behind [Jun OS](https://github.com/efficiencyx/JunOS). Jun is the character from the visual novel *My Dystopian Robot Girlfriend*; the fine-tune gives the base model her voice, her moods and her way of deciding when a tool is worth calling.
|
| 26 |
+
|
| 27 |
+
The LoRA is merged into the base weights. These are standalone models, no `--lora` flag needed.
|
| 28 |
+
|
| 29 |
+
### What's new in v9
|
| 30 |
+
|
| 31 |
+
- **Fresh LoRA** on a rebuilt dataset of 4,235 conversations, every one rendered through the prompt builder [Jun OS](https://github.com/efficiencyx/JunOS) uses, so training prompts and production prompts are the same bytes.
|
| 32 |
+
- **The three effort levels are now different.** `<think:low>`, `<think:med>` and `<think:high>` each have their own trace shape and length. v8 often wrote about the same amount at every level.
|
| 33 |
+
- **She answers in your language.** Write to her in Italian, Spanish, German or Japanese and the reply comes back in it.
|
| 34 |
+
- **Better tool judgement**: more right calls, fewer calls nobody asked for, and she saves more of the things worth remembering.
|
| 35 |
+
- **No preference tuning on top.** The supervised set already teaches when to reach for a tool, which is what a DPO pass would target. Every DPO and RPO round trained on top of this checkpoint scored worse on scenes held out from training: more right calls on familiar scenes, more stray calls and fewer right ones on new ones. So the release is the supervised checkpoint.
|
| 36 |
+
- **The trace is written before the tool result exists.** In v8 and v9-beta some reasoning already "knew" what a tool would return. v9 traces decide first and read the result after.
|
| 37 |
+
|
| 38 |
+
### v9 against v8
|
| 39 |
+
|
| 40 |
+
Both models on the same prompts, scenes neither was trained on, sampled at the app's settings.
|
| 41 |
+
|
| 42 |
+
| | v8 `Q4_K_M` | v9 `Q4_K_M` | v9 `Q6_K` |
|
| 43 |
+
|:--|--:|--:|--:|
|
| 44 |
+
| Right tool when one is needed | 21/45 | 23/45 | **27/45** |
|
| 45 |
+
| Tool call when none is needed | 10/105 | 9/105 | **5/105** |
|
| 46 |
+
| Saves a memory when she should | 17/54 | **27/54** | 21/54 |
|
| 47 |
+
| `low` shorter than `med` shorter than `high`, same scene | 26/50 | 42/50 | **47/50** |
|
| 48 |
+
|
| 49 |
+
`Q6_K` and `Q8_0` keep the full `high` trace (about 250 words). `Q4_K_M` writes it about a third shorter.
|
| 50 |
+
|
| 51 |
+
## Files
|
| 52 |
+
|
| 53 |
+
| Quant | Size | Quantization | Use case |
|
| 54 |
+
|:------|:-----|:-------------|:---------|
|
| 55 |
+
| Q8_0 | 8.0 GB | plain | Best quality |
|
| 56 |
+
| Q6_K | 6.2 GB | **imatrix** | High quality |
|
| 57 |
+
| Q4_K_M | 5.3 GB | **imatrix** | Fits 6 GB VRAM |
|
| 58 |
+
|
| 59 |
+
`Q4_K_M` and `Q6_K` are imatrix quants under the standard names, so tools and installers that pull `:Q4_K_M` / `:Q6_K` keep working. `Q8_0` is plain: at 8 bits llama.cpp rounds to nearest and does not use an importance matrix. All three come from the same full-precision merge.
|
| 60 |
+
|
| 61 |
+
Older generations: [v8](https://huggingface.co/efficiencyx/Jun-LoRA-E4B-GGUF), [v7](https://huggingface.co/efficiencyx/Jun-LoRA-v7-E4B-GGUF).
|
| 62 |
+
|
| 63 |
+
## Usage
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
llama-server -m Jun-LoRA-E4B.Q4_K_M.gguf --jinja -ngl 99 -c 8192
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
`--jinja` is required. Without it llama.cpp ignores the embedded chat template and tool calls come back as plain text.
|
| 70 |
+
|
| 71 |
+
With Ollama:
|
| 72 |
+
|
| 73 |
+
```bash
|
| 74 |
+
ollama pull hf.co/efficiencyx/Jun-LoRA-v9-E4B-GGUF:Q4_K_M
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
For image or audio input add `--mmproj Jun-LoRA-E4B.BF16-mmproj.gguf`. The adapter never touches the embedder, so that file is the base model's.
|
| 78 |
+
|
| 79 |
+
### Reasoning depth
|
| 80 |
+
|
| 81 |
+
Put one of these at the very end of the user turn, after a blank line, which is where [Jun OS](https://github.com/efficiencyx/JunOS) puts it:
|
| 82 |
+
|
| 83 |
+
```
|
| 84 |
+
<think:low> <think:med> <think:high>
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
`low` is a few lines, `med` drafts two options and picks one, `high` reasons step by step and drafts three. Every trace ends with a one-line tool decision before the reply. llama.cpp returns the trace as `reasoning_content`, separate from `content`, so give `max_tokens` room for both: a `high` trace runs to a few hundred words.
|
| 88 |
+
|
| 89 |
+
v9 was trained to think on every turn. With thinking switched off some frontends file the whole output as reasoning and show an empty reply; if that happens, leave thinking on and use `<think:low>`.
|
| 90 |
+
|
| 91 |
+
## Why imatrix
|
| 92 |
+
|
| 93 |
+
The base model is QAT, so its weights already sit on the 4-bit grid. Merging a LoRA moves them off it, and a plain `Q4_K_M` rounds part of the fine-tune back off. `Q4_K_M` and `Q6_K` here are quantized with an importance matrix measured on v9-format conversations at all three effort levels, so the quantizer keeps its precision for the weights those conversations use.
|
| 94 |
+
|
| 95 |
+
## Intended use
|
| 96 |
+
|
| 97 |
+
The chat backend for [Jun OS](https://github.com/efficiencyx/JunOS), a local companion app. She is one character, not a general assistant.
|
| 98 |
+
|
| 99 |
+
- Tool use is weaker outside English than in it, even though the replies come back in the right language.
|
| 100 |
+
- What she says is fiction, not facts or advice.
|
| 101 |
+
- Far from the training prompts (no system prompt, no live context) she drifts back toward base Gemma.
|
| 102 |
+
- Biases of the Gemma 4 base weights carry over.
|
| 103 |
+
|
| 104 |
+
## Training
|
| 105 |
+
|
| 106 |
+
| Parameter | Value |
|
| 107 |
+
|:----------|:------|
|
| 108 |
+
| Base model | `unsloth/gemma-4-E4B-it-qat-q4_0-unquantized` |
|
| 109 |
+
| Method | LoRA (rsLoRA), rank 32, alpha 32 |
|
| 110 |
+
| Target | language tower only |
|
| 111 |
+
| Loss | completion only, 50 conversations held out |
|
| 112 |
+
| Checkpoint | step 600 |
|
| 113 |
+
| GGUF export | llama.cpp |
|
| 114 |
+
|
| 115 |
+
llama.cpp's LoRA converter ignores `use_rslora`, so `lora_alpha` was set to `32 * sqrt(32) = 181.02` before conversion. That gives the rsLoRA scale exactly.
|
| 116 |
+
|
| 117 |
+
## System prompt
|
| 118 |
+
|
| 119 |
+
The model expects the system prompt [Jun OS](https://github.com/efficiencyx/JunOS) sends, with gauges, clock and recalled memories appended to the end of the user's message. It lives in the app's repository as `webapp/system_prompt.txt`.
|
| 120 |
+
|
| 121 |
+
## Acknowledgments
|
| 122 |
+
|
| 123 |
+
- **Incontinent Cell** for [*My Dystopian Robot Girlfriend*](https://incontinentcell.itch.io/) and for Jun
|
| 124 |
+
- **Google** for the [Gemma 4](https://ai.google.dev/gemma) model family
|
| 125 |
+
- **Unsloth** for the efficient model
|