Image-Text-to-Text
Transformers
Safetensors
qwen3_5
decision-making
routing
mixture-of-experts
moqle
lora
agents
e2e-testing
games
multilingual
on-device
system-one
conversational
Instructions to use labqoat/squad-0.8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use labqoat/squad-0.8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="labqoat/squad-0.8b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("labqoat/squad-0.8b") model = AutoModelForMultimodalLM.from_pretrained("labqoat/squad-0.8b", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use labqoat/squad-0.8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "labqoat/squad-0.8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "labqoat/squad-0.8b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/labqoat/squad-0.8b
- SGLang
How to use labqoat/squad-0.8b 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 "labqoat/squad-0.8b" \ --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": "labqoat/squad-0.8b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "labqoat/squad-0.8b" \ --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": "labqoat/squad-0.8b", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use labqoat/squad-0.8b with Docker Model Runner:
docker model run hf.co/labqoat/squad-0.8b
squad-0.8b 2026-10-26: retrained e2e expert (real web-app data, held-out tests 29/82 vs 17/82), prefix cache in the runtime
091795c verified Download qev_fast/encoder.py from labqoat/squad-0.8b: direct link, hf CLI and curl.
- Browser
- Download file 6.32 kB
-
https://huggingface.co/labqoat/squad-0.8b/resolve/main/qev_fast/encoder.py
- Command line
-
hf download hf://labqoat/squad-0.8b/qev_fast/encoder.py
-
curl -L -o encoder.py https://huggingface.co/labqoat/squad-0.8b/resolve/main/qev_fast/encoder.py
6.32 kB
| """A fast, token-identical System One prompt encoder (qev_fast.systemone.encode without decider's per-piece | |
| transformers calls). | |
| decider.prompt.build (state-first, plain layout, no shuffling, max_options = MAX_OPTIONS) encodes, per request: | |
| - "Context:\\n" + the rendered state, as one string; | |
| - per question row k, either one string (<= NARROW options: header, "\\n(A) option" lines, answer tail), or (wide) the | |
| header, then per option the ids of "\\n(" + its label token + the ids of ") option", then the answer tail. | |
| FastEncoder builds exactly those strings (decider's own render_state / render_question / plan_rows and | |
| systemone.neutralize_options), encodes all strings of all requests of a call in one Rust `encode_batch` of the | |
| tokenizer backend (the same tokenizer object transformers' fast tokenizer wraps, so the same ids), caches the strings | |
| that repeat (option texts, whole narrow question blocks of fixed schemas) and assembles ids / slots / nopts / golds. | |
| Anything it does not model (more than MAX_OPTIONS options) goes to the reference encoder; `stats` counts both. | |
| """ | |
| import json | |
| from decider.prompt import LETTERS, MAX_OPTIONS, NARROW, label_table | |
| from decider.systemone import plan_rows, render_question, render_state, row_types | |
| from . import systemone as S1 | |
| class FastEncoder: | |
| def __init__(self, tok, cache_size: int = 200_000): | |
| self.tok = tok | |
| self.raw = tok.backend_tokenizer # tokenizers.Tokenizer (Rust) | |
| _, self.lab_ids, self.open_ids = label_table(tok) | |
| self.cache: dict = {} | |
| self.cache_size = cache_size | |
| self.stats = {"fast": 0, "fallback": 0, "cache_hits": 0, "strings_encoded": 0} | |
| # ---- planning: the strings decider.prompt.build encodes --------------------------------------------------------- | |
| def _plan(self, state, questions: dict): | |
| ctx = render_state(state) # as S1.encode (callers pass a string or what render_state accepts) | |
| rqs = {k: render_question(v) for k, v in questions.items()} | |
| flat, index = plan_rows(rqs, False) | |
| multi = len(flat) > 1 | |
| parts = [("s", "Context:\n" + ctx, False)] # (kind, string, cacheable) | |
| rows = [] | |
| for k, r in enumerate(flat): | |
| opts = S1.neutralize_options(r["options"]) | |
| if len(opts) > MAX_OPTIONS: | |
| return None # option sampling (decider keeps the gold + abstain options): the reference handles it | |
| head = f"\n\nQuestion{' ' + str(k + 1) if multi else ''}: {r['question']}\nOptions:" | |
| tail = f"\nAnswer{' ' + str(k + 1) if multi else ''}: (" | |
| if len(opts) <= NARROW: | |
| parts.append(("s", head + "".join(f"\n({LETTERS[j]}) {o}" for j, o in enumerate(opts)) + tail, True)) | |
| rows.append(("n", len(parts) - 1, len(opts))) | |
| else: | |
| h = len(parts) | |
| parts.append(("s", head, True)) | |
| for o in opts: | |
| parts.append(("s", f") {o}", True)) | |
| parts.append(("s", tail, True)) | |
| rows.append(("w", h, len(opts))) | |
| return rqs, index, parts, rows | |
| # ---- encoding ----------------------------------------------------------------------------------------------- | |
| def encode_many(self, requests: list) -> list: | |
| """[(state, questions)] -> per request S1.encode's dict (+ "golds"), or an exception instance for a request | |
| the prompt builder refuses (ValueError / KeyError / TypeError / AssertionError, as S1.encode raises).""" | |
| plans, todo = [], {} | |
| for state, qs in requests: | |
| try: | |
| p = self._plan(state, qs) | |
| except (ValueError, KeyError, TypeError, AssertionError) as e: | |
| plans.append(e) | |
| continue | |
| plans.append(p if p is not None else ("fallback", state, qs)) | |
| if p is not None: | |
| for _kind, s, cacheable in p[2]: | |
| if not (cacheable and s in self.cache): | |
| todo[s] = None | |
| else: | |
| self.stats["cache_hits"] += 1 | |
| if todo: | |
| strs = list(todo) | |
| enc = self.raw.encode_batch(strs, add_special_tokens=False) | |
| for s, e in zip(strs, enc, strict=True): | |
| todo[s] = e.ids | |
| self.stats["strings_encoded"] += len(strs) | |
| out = [] | |
| for p in plans: | |
| if isinstance(p, Exception): | |
| out.append(p) | |
| continue | |
| if p[0] == "fallback": | |
| self.stats["fallback"] += 1 | |
| try: | |
| e = S1.encode(self.tok, p[1], p[2]) | |
| e["golds"] = None | |
| out.append(e) | |
| except (ValueError, KeyError, TypeError, AssertionError) as ex: | |
| out.append(ex) | |
| continue | |
| rqs, index, parts, rows = p | |
| def ids_of(i): | |
| s, cacheable = parts[i][1], parts[i][2] | |
| v = todo.get(s) | |
| if v is None: | |
| v = self.cache[s] | |
| elif cacheable and len(self.cache) < self.cache_size: | |
| self.cache[s] = v | |
| return v | |
| ids = list(ids_of(0)) | |
| state_len = len(ids) # "Context:\n" + the state, encoded as one string: the row's state prefix | |
| slots, nopts = [], [] | |
| for kind, i, n in rows: | |
| if kind == "n": | |
| ids += ids_of(i) | |
| else: | |
| ids += ids_of(i) | |
| for j in range(n): | |
| ids += self.open_ids | |
| ids.append(self.lab_ids[j]) | |
| ids += ids_of(i + 1 + j) | |
| ids += ids_of(i + 1 + n) | |
| slots.append(len(ids) - 1) | |
| nopts.append(n) | |
| self.stats["fast"] += 1 | |
| out.append({"ids": ids, "slots": slots, "nopts": nopts, "golds": [0] * len(rows), "rqs": rqs, | |
| "index": index, "types": row_types(rqs, index), "state_len": state_len}) | |
| return out | |
| def encode(self, state, questions: dict) -> dict: | |
| e = self.encode_many([(state, questions)])[0] | |
| if isinstance(e, Exception): | |
| raise e | |
| return e | |