Instructions to use eltokh7/lory-4b-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eltokh7/lory-4b-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="eltokh7/lory-4b-v2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("eltokh7/lory-4b-v2") model = AutoModel.from_pretrained("eltokh7/lory-4b-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Lory-4B v2
A fast, 8 GB single-forward-pass decision model for simulated survey respondents and economic experiments.
Lory-4B v2 brings strong economic logic and empirical human choice prediction to a single consumer GPU or Apple Silicon Mac. Hand it an agent's traits and a decision question, and it returns calibrated probabilities over every option in one forward pass โ no text generation and no sampling variance.
- Matches Lory-27B v1 on sealed blind generalization (
73vs73) at less than one-sixth the size. - Beats much larger hosted decision models (
Perplexity Decider v1.2,Jev 1.14,GPT-6 Luna Decisions) on economic decision logic (DLS v0.2: 82). - Predicts real human gamble choices (
Choices13k) more accurately than a reasoning LLM (GLM-5.3) in one forward pass (r = +0.79,10.3 ppMAE vs+0.78,14.9 pp). - Two modes in one checkpoint: Economically consistent by default; add a
styletrait to switch cleanly to empirical human behavior.
Ships as fully merged bf16 weights (~8 GB) โ self-contained with zero adapter merging at startup and native support for CUDA and Apple Silicon MLX via kev.serve. For the flagship tier, see Lory-27B v2.
Performance
1. Economic Logic & Generalization
| Model | DLS v0.2 (9 families) | Stakes Sensitivity | Blind v1 | Bank-Run Payoff Shift (theory 80) | Lottery Slope (theory 1.0) | Sealed Blind v3 (569 tests) |
|---|---|---|---|---|---|---|
| Lory-4B v2 | 82 | 76 | 86 | 38.0 | 0.68 | 73 |
| Lory-4B v1 | 79 | 74 | 81 | 28.5 | 0.51 | โ |
| Kev-4B (base) | 53 | 38 | 67 | โ1.0 | 0.05 | โ |
| Perplexity Decider v1.2 | 77 | 65 | 93 | 9.0 | 0.43 | โ |
| Jev 1.14 | 77 | 64 | โ | 3.0 | โ | โ |
| Lory-27B v1 (ref) | 88 | 82 | 92 | 66.5 | 0.77 | 73 |
| Lory-27B v2 (ref) | 89 | 85 | 95 | 63.5 | 0.94 | 80 |
2. Predicting Real Human Choices
| Model | Choices13k Gambles (r / MAE / same side) | Untouched Psych-101/201 (6 studies, r / MAE) | Behavioral Phenomena (typ / def / switch gap) | Sealed Unseen Phenomena (14 tests, typ / def / gap) |
|---|---|---|---|---|
| Lory-4B v2 | +0.79 / 10.3 pp / 82% |
+0.69 / 13.2 pp |
57.9 / 40.3 (+17.6) |
50.4 / 36.7 (+13.7) |
| Lory-4B v1 | โ | โ | 32.6 / 32.5 (+0.1) |
โ |
| GLM-5.3 (reasoning, ref) | +0.78 / 14.9 pp / 79% |
โ | โ | โ |
| Lory-27B v2 (ref) | +0.85 / 8.9 pp / 86% |
+0.75 / 12.4 pp |
68.1 / 51.7 (+16.4) |
53.9 / 45.7 (+8.2) |
On untouched trial-level human experiments (Psych-101/201), Lory-4B v2 tracks Ultimatum game offers at r = +0.99 (7 pp MAE) and 2ร2 strategic games (Zhu et al. 2024) at r = +0.82 (14 pp MAE), with zero regression on Kev's decision-v7 suite (0.868 vs 0.866 v1).
Quickstart
1. Start the server
Runs locally on any 16+ GB GPU (--device cuda) or Apple Silicon Mac (--device mps, automatically accelerated via MLX):
git clone https://github.com/jaredpalmer/kev && cd kev && git checkout 2074cc4 && uv sync --extra serve
uv run python -m kev.serve --run eltokh7/lory-4b-v2 --device cuda --port 8850 # or --device mps on Mac
2. Query in default mode (economically consistent)
import requests
state = (
"You are answering questions as if you were a human. Do not break character.\n"
"Your traits: {'persona': 'You are 34, a teacher in Ohio earning $52,000.', "
"'money': 'You watch every dollar.'}"
)
resp = requests.post(
"http://127.0.0.1:8850/v1/systemone",
json={
"state": state,
"questions": {
"plan": {
"type": "choice",
"instructions": "Which phone plan do you pick?",
"criteria": {
"budget": "$30/month, 5 GB",
"large": "$45/month, 20 GB",
"dominated": "$45/month, 5 GB",
},
}
},
},
)
print(resp.json()["answers"]["plan"]["probabilities"])
3. Switch to typical-person mode (empirical human behavior)
Add a style key to the traits dictionary:
state = (
"You are answering questions as if you were a human. Do not break character.\n"
"Your traits: {'persona': 'You are 35, live in Ohio, and earn about $55,000 a year.', "
"'style': 'You answer like an ordinary person going with your gut, not by doing math.'}"
)
4. Run full EDSL surveys
Use edsl_decision.py (included in this repo) to run any EDSL Survey with Agents and Scenarios against the server, returning a DataFrame of answer probabilities (multiple choice, yes/no, linear scale, Likert; optional option rotations).
Throughput & Cost
- Speed: 50+ requests/s on a single A100; fast local serving on Apple Silicon via MLX (
~8 GBmemory footprint). - Cost: Under $0.25 per 1,000 respondents ร 20 questions on rented GPU compute.
Notes & Attribution
- When to upgrade to 27B: For complex multi-player equilibrium games or maximum numerical precision on subtle stakes shifts, use Lory-27B v2.
- Scope: English prompts, primarily US-style personas and dollar amounts.
- Technical report: A separate technical report detailing the training data, evaluation protocol, and model construction is forthcoming.
- Attribution: Built on Kev and Kev-4B by Jared Palmer (Apache-2.0); Qwen3.5-4B-Base backbone (Qwen, Apache-2.0).
- Downloads last month
- 18