Instructions to use FerrellSyntheticIntelligence/fsi-anomaly with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use FerrellSyntheticIntelligence/fsi-anomaly 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 FerrellSyntheticIntelligence/fsi-anomaly # Run inference directly in the terminal: llama cli -hf FerrellSyntheticIntelligence/fsi-anomaly
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf FerrellSyntheticIntelligence/fsi-anomaly # Run inference directly in the terminal: llama cli -hf FerrellSyntheticIntelligence/fsi-anomaly
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf FerrellSyntheticIntelligence/fsi-anomaly # Run inference directly in the terminal: ./llama-cli -hf FerrellSyntheticIntelligence/fsi-anomaly
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf FerrellSyntheticIntelligence/fsi-anomaly # Run inference directly in the terminal: ./build/bin/llama-cli -hf FerrellSyntheticIntelligence/fsi-anomaly
Use Docker
docker model run hf.co/FerrellSyntheticIntelligence/fsi-anomaly
- LM Studio
- Jan
- Ollama
How to use FerrellSyntheticIntelligence/fsi-anomaly with Ollama:
ollama run hf.co/FerrellSyntheticIntelligence/fsi-anomaly
- Unsloth Desktop
- Docker Model Runner
How to use FerrellSyntheticIntelligence/fsi-anomaly with Docker Model Runner:
docker model run hf.co/FerrellSyntheticIntelligence/fsi-anomaly
- Lemonade
How to use FerrellSyntheticIntelligence/fsi-anomaly with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull FerrellSyntheticIntelligence/fsi-anomaly
Run and chat with the model
lemonade run user.fsi-anomaly-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
| """Unit tests for multi-token prediction (Meta MTP) support. | |
| Run: .venv/bin/python tests/test_mtp.py | |
| """ | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| import torch | |
| import torch.nn.functional as F | |
| from model.config import TinyLiquidConfig, CONFIGS | |
| from model.tiny_liquid import TinyLiquid | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def make_model(vocab=512, mtp=2): | |
| cfg = TinyLiquidConfig(vocab_size=vocab, mtp_heads=mtp, **CONFIGS["micro6m"]) | |
| return TinyLiquid(cfg) | |
| def test_forward_mtp_shapes(): | |
| m = make_model() | |
| ids = torch.randint(0, 512, (2, 16)) | |
| logits, aux = m.forward_mtp(ids) | |
| assert tuple(logits.shape) == (2, 16, 512) | |
| assert len(aux) == 2 and all(tuple(a.shape) == (2, 16, 512) for a in aux) | |
| # main forward unchanged | |
| assert tuple(m(ids).shape) == (2, 16, 512) | |
| def test_mtp_loss_backward(): | |
| m = make_model() | |
| ids = torch.randint(0, 512, (2, 24)) | |
| logits, aux = m.forward_mtp(ids) | |
| loss = F.cross_entropy(logits.reshape(-1, 512), ids.reshape(-1)) | |
| for k, a in enumerate(aux): | |
| off = k + 2 | |
| loss = loss + 0.1 * F.cross_entropy( | |
| a[:, :-off].reshape(-1, 512), ids[:, off:].reshape(-1)) | |
| loss.backward() | |
| assert m.mtp_heads[0][0].weight.grad is not None | |
| assert m.tok_emb.weight.grad is not None | |
| assert torch.isfinite(loss) | |
| def test_mtp_checkpoint_roundtrip(): | |
| m = make_model() | |
| sd = {"config": m.cfg.__dict__, "model": m.state_dict()} | |
| m2 = TinyLiquid(TinyLiquidConfig(**sd["config"])) | |
| missing, unexpected = m2.load_state_dict(sd["model"], strict=True) | |
| assert not missing and not unexpected | |
| def test_train_lm_mtp_smoke(tmp=None): | |
| tmp = Path(tmp or (ROOT / "data" / "_mtp_smoke")) | |
| tmp.mkdir(parents=True, exist_ok=True) | |
| import numpy as np | |
| rng = np.random.default_rng(0) | |
| (tmp / "train.bin").write_bytes(rng.integers(1, 500, size=20000, dtype=np.uint16).tobytes()) | |
| (tmp / "valid.bin").write_bytes(rng.integers(1, 500, size=5000, dtype=np.uint16).tobytes()) | |
| ckpt = tmp / "ckpt" | |
| cmd = [ | |
| sys.executable, "-u", "train/train_lm.py", | |
| "--data", str(tmp / "train.bin"), "--val", str(tmp / "valid.bin"), | |
| "--tok", "data/tokenizer.json", "--config", "micro6m", | |
| "--ckpt", str(ckpt), "--batch", "2", "--seq", "32", | |
| "--lr", "1e-4", "--warmup", "0", "--steps", "3", | |
| "--eval-every", "2", "--save-every", "2", "--threads", "2", | |
| "--mtp", "2", "--log-every", "1", | |
| ] | |
| env = {"PYTHONPATH": str(ROOT)} | |
| r = subprocess.run(cmd, capture_output=True, text=True, cwd=ROOT, env=env, | |
| timeout=300) | |
| assert r.returncode == 0, r.stderr[-1500:] | |
| saved = sorted((ckpt).glob("*.pt")) | |
| assert saved, "no checkpoint saved" | |
| import torch as T | |
| sd = T.load(saved[-1], map_location="cpu", weights_only=False) | |
| assert sd["config"]["mtp_heads"] == 2 | |
| assert any("mtp_heads" in k for k in sd["model"]) | |
| for f in ["train.bin", "valid.bin"]: | |
| (tmp / f).unlink() | |
| for f in ckpt.glob("*.pt"): | |
| f.unlink() | |
| ckpt.rmdir() | |
| tmp.rmdir() | |
| if __name__ == "__main__": | |
| fns = [v for k, v in sorted(globals().items()) if k.startswith("test_")] | |
| for fn in fns: | |
| fn() | |
| print(f"ok {fn.__name__}") | |
| print(f"\n{len(fns)} mtp tests passed") | |