Instructions to use lomelidev/Lissa1-4B-DFlash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lomelidev/Lissa1-4B-DFlash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lomelidev/Lissa1-4B-DFlash", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("lomelidev/Lissa1-4B-DFlash", trust_remote_code=True) model = AutoModel.from_pretrained("lomelidev/Lissa1-4B-DFlash", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lomelidev/Lissa1-4B-DFlash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lomelidev/Lissa1-4B-DFlash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lomelidev/Lissa1-4B-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/lomelidev/Lissa1-4B-DFlash
- SGLang
How to use lomelidev/Lissa1-4B-DFlash 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 "lomelidev/Lissa1-4B-DFlash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lomelidev/Lissa1-4B-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "lomelidev/Lissa1-4B-DFlash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lomelidev/Lissa1-4B-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use lomelidev/Lissa1-4B-DFlash with Docker Model Runner:
docker model run hf.co/lomelidev/Lissa1-4B-DFlash
Lissa1-4B-DFlash
Experimental speculative-decoding drafter for Lissa1-4B.
This repository is a sidecar, not a standalone language model. It must be paired with the compatible Lissa1-4B target, tokenizer and serving engine. The drafter proposes tokens; the target verifies them.
Developer-to-developer rule: speculative decoding is a serving optimization, not a quality upgrade. A draft can raise acceptance and still reduce net tok/s if verification and draft overhead cost more than it saves. Always benchmark the exact target quant, engine, prompt domain and block size you intend to deploy.
Recommended current setup
For Apple Silicon, use the community draft as the current baseline:
python -m mlx_vlm generate \
--model ./4bit \
--draft-model z-lab/Qwen3.5-4B-DFlash \
--draft-kind dflash \
--draft-block-size 8 \
--prompt "Explain this race condition and propose a minimal safe patch." \
--max-tokens 256 \
--temperature 0 \
--no-verbose
For vLLM/SGLang, use the engine's installed DFlash speculative-decoding flags and this target/draft pair. The flag spelling changes across engine releases; inspect vllm serve --help or the SGLang launcher help before copying a command from another version.
For llama.cpp, the current experimental form is:
./llama-server \
-m Lissa1-4B-Q4_K_M.gguf \
-md Lissa1-4B-DFlash.gguf \
--spec-type draft-dflash \
--spec-draft-n-max 8 \
-ngl 99 -ngld all -fa on --jinja --port 8080
Measured results
MLX acceptance smoke
| Drafter | Block | Accepted tok/round | Draft acceptance |
|---|---|---|---|
community z-lab/Qwen3.5-4B-DFlash |
8 | 2.78 | 55.4% |
community z-lab/Qwen3.5-4B-DFlash |
16 | 2.78 | 50.0% |
| this Lissa drafter | 8 | 1.57 | 18.8% |
| this Lissa drafter | 16 | 1.57 | 17.9% |
The community draft is external and is not claimed as a Lissa-trained checkpoint. It is the current serving baseline while this drafter is retrained on larger Lissa-generated data.
GPU serving
The community draft paired with the corrected Lissa FP8 target measured:
- vLLM:
173.88 β 242.99 tok/s; - SGLang:
171.86 β 249.97 tok/s.
The own draft is currently net-negative in the measured AWQ matrix:
- vLLM:
197.95 β 153.0 tok/s; - SGLang:
204.12 β 138.8 tok/s.
llama.cpp
With Lissa Q4_K_M and the -fa on --spec-draft-n-max 16 path:
Target only: 143.70 tok/s
Community DFlash: 124.47 tok/s
Own DFlash: 69.49 tok/s
That is an exploratory ranking without a complete acceptance delta, not a final deployment verdict. The current target-specific training gate is also failed: 1.1014x measured versus a 1.6x promotion target.
Why this is experimental
The target was heavily fine-tuned after the base drafter distribution was learned. The current own drafter was trained on an older 2,500-row cache and does not follow the final Lissa distribution closely enough. The next run is being rebuilt as:
Lissa-generated prompts/completions
β pure-Transformers hidden-state capture
β shape/NaN/dtype validation
β 1-step and 50-step training smoke
β full DFlash training
β HF/GGUF export
β net tok/s + acceptance matrix
The draft will be promoted only if it beats target-only on the serving domain, not merely because its acceptance percentage looks good.
Sampling and evaluation
Use greedy decoding for acceptance measurements. For normal developer traffic:
- patches and tool calls: temperature
0β0.2, top_p0.9β1.0; - debugging: temperature
0.2β0.4, top_p0.9; - architecture exploration: temperature
0.4β0.6, top_p0.9β0.95.
Record proposed tokens, accepted tokens, acceptance length, wall time and net tok/s. Test Spanish chat, code, tool calls and long context separately.
Long-context caution
The Ornith-1.5-9B ia-lab evidence is useful for designing the Lissa1 tests: Q4/Q4 KV, Flash Attention, slots, continuous batching and explicit context ladders. It is not a Lissa1 result. The historical report found DFlash useful in single-slot short-context work but less attractive at 512K; the Lissa1 decision must be based on its own net tok/s and domain prompts.
Also, the Ornith vLLM MTP result must not be copied here. Lissa1-4B has zero MTP tensors after the merge. This repository is for the DFlash sidecar path only.
Links
- Lissa1 target model
- GGUF target
- FP8 target
- AWQ target
- MLX target
- External community draft
- Lissa1-DFlash collection
Future QLoRA adapters are separate from this drafter: database, frontend, backend, devops/cicd, agents/tools, security and platform. The drafter will be retrained against the final base/model distribution rather than silently reused across those adapters.
- Downloads last month
- 35
Model tree for lomelidev/Lissa1-4B-DFlash
Base model
lomelidev/Lissa1-4B