Text Generation
Transformers
Safetensors
GGUF
English
qwen3
search
rag
question-answering
on-device
tiny
muon
text-generation-inference
Instructions to use ahkamboh/tiny-search-reader-60M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ahkamboh/tiny-search-reader-60M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ahkamboh/tiny-search-reader-60M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ahkamboh/tiny-search-reader-60M") model = AutoModelForCausalLM.from_pretrained("ahkamboh/tiny-search-reader-60M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ahkamboh/tiny-search-reader-60M 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 ahkamboh/tiny-search-reader-60M:Q4_K_M # Run inference directly in the terminal: llama cli -hf ahkamboh/tiny-search-reader-60M:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ahkamboh/tiny-search-reader-60M:Q4_K_M # Run inference directly in the terminal: llama cli -hf ahkamboh/tiny-search-reader-60M:Q4_K_M
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 ahkamboh/tiny-search-reader-60M:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ahkamboh/tiny-search-reader-60M:Q4_K_M
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 ahkamboh/tiny-search-reader-60M:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ahkamboh/tiny-search-reader-60M:Q4_K_M
Use Docker
docker model run hf.co/ahkamboh/tiny-search-reader-60M:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ahkamboh/tiny-search-reader-60M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ahkamboh/tiny-search-reader-60M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ahkamboh/tiny-search-reader-60M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ahkamboh/tiny-search-reader-60M:Q4_K_M
- SGLang
How to use ahkamboh/tiny-search-reader-60M 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 "ahkamboh/tiny-search-reader-60M" \ --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": "ahkamboh/tiny-search-reader-60M", "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 "ahkamboh/tiny-search-reader-60M" \ --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": "ahkamboh/tiny-search-reader-60M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use ahkamboh/tiny-search-reader-60M with Ollama:
ollama run hf.co/ahkamboh/tiny-search-reader-60M:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use ahkamboh/tiny-search-reader-60M with Docker Model Runner:
docker model run hf.co/ahkamboh/tiny-search-reader-60M:Q4_K_M
- Lemonade
How to use ahkamboh/tiny-search-reader-60M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ahkamboh/tiny-search-reader-60M:Q4_K_M
Run and chat with the model
lemonade run user.tiny-search-reader-60M-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download eval/grade.py from ahkamboh/tiny-search-reader-60M: direct link, hf CLI and curl.
- Browser
- Download file 4.56 kB
-
https://huggingface.co/ahkamboh/tiny-search-reader-60M/resolve/main/eval/grade.py
- Command line
-
hf download hf://ahkamboh/tiny-search-reader-60M/eval/grade.py
-
curl -L -o grade.py https://huggingface.co/ahkamboh/tiny-search-reader-60M/resolve/main/eval/grade.py
4.56 kB
| """How the exam answers are graded. Copied from the training code (finetune_search.is_correct / verdict and | |
| searchfmt.normalize), standard library only. | |
| python grade.py google_big.jsonl [more.jsonl ...] re-grades the "answer" field of each row and prints | |
| accuracy, overall and per kind | |
| Verdicts: answered_correct, wrong, missed (said "not found" but the results held the answer) for questions with | |
| gold answers; trap_caught / trap_fooled for questions with no gold answer (the right reply is "not found"). | |
| Accuracy = (answered_correct + trap_caught) / all questions. | |
| """ | |
| import collections | |
| import json | |
| import re | |
| import string | |
| import sys | |
| NOT_FOUND = "not found" | |
| VERDICTS = ("answered_correct", "missed", "wrong", "trap_caught", "trap_fooled") | |
| def normalize(s): | |
| # Same normalization as the official SQuAD script: lowercase, no punctuation, no a/an/the. | |
| s = "".join(ch for ch in s.lower() if ch not in set(string.punctuation)) | |
| s = re.sub(r"\b(a|an|the)\b", " ", s) | |
| return " ".join(s.split()) | |
| def said_not_found(pred): | |
| return normalize(pred) in ("", normalize(NOT_FOUND)) | |
| DIGITS = "0123456789" | |
| STOP = set("""a an the of in on at to for by with from into about between and or but is are was were be been being | |
| it its this that these those as than then there their his her he she they them we you your our my me i | |
| which who whom whose what when where why how do does did has have had will would can could should s t""".split()) | |
| def inside(text, g): | |
| """g is in text (both normalized) and not part of a longer number or word. Only a digit can extend a | |
| number, because snippets glue units and signs to it: "₨277.06", "97°f" and "rs39066ltr" hold 277.06, 97 and | |
| 390.66, while "2,277.08" does not hold 277.08 and "jupiters" does not hold jupiter.""" | |
| def edge(c): | |
| return "[0-9]" if c in DIGITS else (r"\w" if c.isalnum() else None) | |
| before, after = edge(g[0]), edge(g[-1]) | |
| pat = (f"(?<!{before})" if before else "") + re.escape(g) + (f"(?!{after})" if after else "") | |
| return re.search(pat, text) is not None | |
| def content(s, asked): | |
| # The words that carry the answer: no stopwords, nothing the question already says. | |
| return [w for w in re.findall(r"\w+", normalize(s)) if w not in STOP and w not in asked] | |
| def is_correct(pred, answers, question=""): | |
| """A gold alias inside the prediction ("277.08 PKR" holds "277.08"), or a close paraphrase: F1 >= 0.5 over the | |
| words the question does not already say, so "Siege of Troy" earns nothing for "Priam of Troy". A gold of one | |
| or two such words must be there whole ("Andy Murray" is not "Andy Burnham"), and a paraphrase must keep | |
| every number ("iPhone 16" is not "iPhone 18"; picking the old model is exactly the mistake this exam is for).""" | |
| p = normalize(pred) | |
| asked = set(re.findall(r"\w+", normalize(question))) | |
| asked |= {w[:-1] for w in asked if w.endswith("s")} # "Arthur's sword" asks about "Arthur" | |
| pc = content(pred, asked) | |
| for g in answers: | |
| gn = normalize(g) | |
| if gn and inside(p, gn): | |
| return True | |
| gc = content(g, asked) | |
| same = sum((collections.Counter(pc) & collections.Counter(gc)).values()) | |
| if not same or (len(gc) <= 2 and same < len(gc)): | |
| continue | |
| if 2 * same / (len(pc) + len(gc)) >= 0.5 and all(inside(p, w) for w in gc if any(c in DIGITS for c in w)): | |
| return True | |
| return False | |
| def verdict(pred, answers, question=""): | |
| if not answers: | |
| return "trap_caught" if said_not_found(pred) else "trap_fooled" | |
| if said_not_found(pred): | |
| return "missed" | |
| return "answered_correct" if is_correct(pred, answers, question) else "wrong" | |
| def accuracy(verdicts): | |
| return 100 * sum(v in ("answered_correct", "trap_caught") for v in verdicts) / max(len(verdicts), 1) | |
| if __name__ == "__main__": | |
| for path in sys.argv[1:]: | |
| rows = [json.loads(x) for x in open(path, encoding="utf-8") if x.strip()] | |
| vs = [verdict(r["answer"], r["answers"], r["question"]) for r in rows] | |
| by_kind = collections.defaultdict(list) | |
| for r, v in zip(rows, vs): | |
| by_kind[r["kind"]].append(v) | |
| ok = sum(v in ("answered_correct", "trap_caught") for v in vs) | |
| kinds = " ".join(f"{k} {sum(v in ('answered_correct', 'trap_caught') for v in x)}/{len(x)}" | |
| for k, x in sorted(by_kind.items())) | |
| print(f"{path}: {ok}/{len(rows)} = {accuracy(vs):.1f}% | {kinds}") | |