Text Generation
Transformers
Safetensors
English
inferno
small-language-model
gqa
custom_code
arithmark
Eval Results (legacy)
Run this model with HF Jobs
Run AlgoDriveAI/Inferno-Exp-1.0 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/AlgoDriveAI/Inferno-Exp-1.0. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/AlgoDriveAI/Inferno-Exp-1.0 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/AlgoDriveAI/Inferno-Exp-1.0. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/AlgoDriveAI/Inferno-Exp-1.0. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use AlgoDriveAI/Inferno-Exp-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlgoDriveAI/Inferno-Exp-1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AlgoDriveAI/Inferno-Exp-1.0", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("AlgoDriveAI/Inferno-Exp-1.0", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AlgoDriveAI/Inferno-Exp-1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlgoDriveAI/Inferno-Exp-1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlgoDriveAI/Inferno-Exp-1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AlgoDriveAI/Inferno-Exp-1.0
- SGLang
How to use AlgoDriveAI/Inferno-Exp-1.0 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 "AlgoDriveAI/Inferno-Exp-1.0" \ --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": "AlgoDriveAI/Inferno-Exp-1.0", "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 "AlgoDriveAI/Inferno-Exp-1.0" \ --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": "AlgoDriveAI/Inferno-Exp-1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AlgoDriveAI/Inferno-Exp-1.0 with Docker Model Runner:
docker model run hf.co/AlgoDriveAI/Inferno-Exp-1.0
Commit ·
aefa39f
1
Parent(s): 941186c
Update README.md
Browse filesAdd inference Gradio
129 unmodified lines13013113213313413513612 unmodified lines149150151152153154129 unmodified lines| Context | 2048 tokens || Tokenizer | Mistral-7B-v0.1 (padded to 32,064); `<|endoftext|>` separates documents || Embeddings | input and output tied || Training | 6B Tokens; AdamW, WSD schedule || Checkpoint | step 290,000 (vanilla_gqa_epochs_r1) |This is a **base model** (no instruction tuning). The model code ships in the repo, so load it with12 unmodified linesprint(tok.decode(out[0], skip_special_tokens=True))```## EvaluationAll scores are zero-shot on the checkpoint in this repo. The ArithMark benchmarks were scored with129 unmodified lines13013113213313413513612 unmodified lines149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387129 unmodified lines| Context | 2048 tokens || Tokenizer | Mistral-7B-v0.1 (padded to 32,064); `<|endoftext|>` separates documents || Embeddings | input and output tied || Training | AlgoDriveAI/SLM_v3, 2 epochs; AdamW, WSD schedule || Checkpoint | step 290,000 (vanilla_gqa_epochs_r1) |This is a **base model** (no instruction tuning). The model code ships in the repo, so load it with12 unmodified linesprint(tok.decode(out[0], skip_special_tokens=True))```## Try it: interactive demo (Gradio)The easiest way to play with the model is a small web app with a prompt box, sampling sliders,live streaming, and a Stop button:1. Open a new notebook at [colab.research.google.com](https://colab.research.google.com) and choose a GPU(Runtime → Change runtime type → T4 GPU). It also runs on CPU, just slower.2. Paste the script below into one cell and run it.3. Click the `*.gradio.live` link it prints.If it stops and asks you to restart the session (it may need to switch Transformers to a compatibleversion), choose Runtime → Restart session and run the cell again.<details><summary><b>Show the Gradio demo script</b> (one Colab cell, ~200 lines)</summary>```python#!/usr/bin/env python3# -*- coding: utf-8 -*-"""INFERNO-EXP-1.0 — simple Gradio inference (loads like any Hub user, no pushing)==============================================================================Loads Inferno-Exp-1.0 with plain Transformers (AutoModelForCausalLM +trust_remote_code=True) and serves a small Gradio app: open prompt box,sampling controls, streaming output with a Stop button, token/speed readout.Works with either source:• the Hub repo: MODEL_SOURCE = "AlgoDriveAI/Inferno-Exp-1.0"• the local export folder the push script builds (test before uploading):MODEL_SOURCE = "/content/hf_export_inferno_exp_1_0"Private repo? Add a Colab secret named HF_TOKEN (🔑 icon in the left sidebar, turn onnotebook access), set the env var HF_TOKEN, or paste a READ token into HF_TOKEN below.It is a base model: it continues text, it does not chat. Write the start of the textyou want (e.g. a word problem followed by "Answer:").Hardcoded constants, no argparse. Paste into one Colab cell and run; open the share link."""# =============================================================================# SETTINGS — edit these# =============================================================================MODEL_SOURCE = "AlgoDriveAI/Inferno-Exp-1.0" # Hub repo id (or a local folder with the same files)HF_TOKEN = "" # only for private repos; "" → Colab secret / env varMODEL_DISPLAY_NAME = "Inferno-Exp-1.0"# Default slider values (all adjustable in the UI)DEF_MAX_NEW_TOKENS = 256DEF_TEMPERATURE = 0.8DEF_TOP_K = 40DEF_TOP_P = 0.95DEF_REPETITION_PENALTY = 1.0DEF_SEED = 42 # -1 = different every runDTYPE = "auto" # "auto" (bf16 on newer GPUs, fp32 on CPU) / "float32" / "bfloat16" / "float16"GRADIO_SHARE = True # public *.gradio.live link (needed in Colab)GRADIO_PORT = 7860INSTALL_DEPENDENCIES = True# =============================================================================# RUN (no edits needed below)# =============================================================================import os, sys, time, threading, subprocesstry:import google.colab # noqa: F401IN_COLAB = Trueexcept ImportError:IN_COLAB = Falseif IN_COLAB and INSTALL_DEPENDENCIES:import importlib.metadata as _mddef _version(name):try:return _md.version(name)except _md.PackageNotFoundError:return None_before = _version("transformers")subprocess.check_call([sys.executable, "-m", "pip", "install", "--quiet","transformers>=4.45,<5", "safetensors", "huggingface_hub>=0.25", "gradio"])if _before != _version("transformers") and "transformers" in sys.modules:raise SystemExit("Transformers was just changed to a compatible version, but the old one is still loaded. ""Restart the session (Runtime → Restart session) and run this cell again.")import torchimport gradio as grfrom transformers import (AutoModelForCausalLM, AutoTokenizer, StoppingCriteria, StoppingCriteriaList,TextIteratorStreamer)DEVICE = "cuda" if torch.cuda.is_available() else "cpu"STOP_EVENT = threading.Event()def get_token():if HF_TOKEN.strip():return HF_TOKEN.strip()if IN_COLAB:try:from google.colab import userdatavalue = userdata.get("HF_TOKEN")if value:return valueexcept Exception:passreturn os.environ.get("HF_TOKEN") or Nonedef pick_dtype():if DTYPE != "auto":return {"float32": torch.float32, "bfloat16": torch.bfloat16, "float16": torch.float16}[DTYPE]if DEVICE == "cuda":return torch.bfloat16 if torch.cuda.get_device_capability()[0] >= 8 else torch.float16return torch.float32class StopOnEvent(StoppingCriteria):"""Ends generate() as soon as the Stop button sets STOP_EVENT."""def __call__(self, input_ids, scores, **kwargs):return STOP_EVENT.is_set()def load():token = None if os.path.isdir(MODEL_SOURCE) else get_token()dtype = pick_dtype()tok = AutoTokenizer.from_pretrained(MODEL_SOURCE, token=token)model = AutoModelForCausalLM.from_pretrained(MODEL_SOURCE, token=token, trust_remote_code=True,torch_dtype=dtype).to(DEVICE).eval()return model, tok, dtypeMODEL, TOK, MODEL_DTYPE = load()CFG = MODEL.configN_PARAMS = sum(p.numel() for p in MODEL.parameters())CONTEXT = CFG.max_position_embeddingsprint(f"Loaded {MODEL_SOURCE}: {N_PARAMS / 1e6:.1f}M params · {DEVICE} · {MODEL_DTYPE}")def generate(prompt, max_new, temperature, top_k, top_p, rep_penalty, seed):STOP_EVENT.clear()if not prompt:yield "", "Type a prompt first."returnids = TOK(prompt, return_tensors="pt", add_special_tokens=False).to(DEVICE)room = CONTEXT - ids["input_ids"].shape[1]if room <= 0:yield prompt, f"Prompt is longer than the model's {CONTEXT}-token context; shorten it."returnseed = int(seed)if seed >= 0:torch.manual_seed(seed)greedy = temperature <= 0sampling = {} if greedy else dict(temperature=float(temperature), top_k=int(top_k), top_p=float(top_p))streamer = TextIteratorStreamer(TOK, skip_prompt=True, skip_special_tokens=True)result = {}def worker():with torch.no_grad():result["ids"] = MODEL.generate(**ids, max_new_tokens=min(int(max_new), room), do_sample=not greedy,repetition_penalty=float(rep_penalty), eos_token_id=TOK.eos_token_id, pad_token_id=TOK.pad_token_id,use_cache=False, streamer=streamer, stopping_criteria=StoppingCriteriaList([StopOnEvent()]), **sampling)started = time.time()thread = threading.Thread(target=worker, daemon=True)thread.start()text = ""for piece in streamer:text += pieceyield prompt + text, f"generating… {time.time() - started:.1f}s"thread.join()new = result["ids"].shape[1] - ids["input_ids"].shape[1] if "ids" in result else 0took = time.time() - startedstatus = "stopped" if STOP_EVENT.is_set() else "done"yield prompt + text, (f"**{status}** · {new} tokens · {took:.1f}s · {new / max(took, 1e-6):.1f} tok/s · "f"{'greedy' if greedy else f'T={temperature} · top-k {int(top_k)} · top-p {top_p}'} · seed {seed}")def output_box():kwargs = dict(label="Output (prompt + continuation)", lines=16, max_lines=30, interactive=False)for extra in (dict(show_copy_button=True), dict(buttons=["copy"]), {}):try:return gr.Textbox(**kwargs, **extra)except TypeError:continuedef build_ui():gr_major = int(gr.__version__.split(".")[0])theme = gr.themes.Soft(primary_hue="indigo", secondary_hue="blue")blocks_kwargs = {} if gr_major >= 6 else dict(theme=theme) # Gradio 6 moved theme to launch()launch_kwargs = dict(theme=theme) if gr_major >= 6 else {}with gr.Blocks(title=MODEL_DISPLAY_NAME, **blocks_kwargs) as demo:gr.Markdown(f"# 🔥 {MODEL_DISPLAY_NAME}\n"f"{N_PARAMS / 1e6:.1f}M-parameter math-first base model · `{CFG.num_hidden_layers}L × {CFG.hidden_size}d` · "f"{CFG.num_attention_heads}Q/{CFG.num_key_value_heads}KV heads · context {CONTEXT} · "f"continues text (not a chat model)")with gr.Row():with gr.Column(scale=3):prompt = gr.Textbox(label="Prompt", lines=6, placeholder="Write the beginning of the text to continue…")with gr.Row():run = gr.Button("Generate", variant="primary")stop = gr.Button("Stop", variant="stop")output = output_box()status = gr.Markdown("")with gr.Column(scale=1):max_new = gr.Slider(16, 1024, value=DEF_MAX_NEW_TOKENS, step=16, label="Max new tokens")temperature = gr.Slider(0.0, 1.5, value=DEF_TEMPERATURE, step=0.05, label="Temperature (0 = greedy)")top_k = gr.Slider(0, 200, value=DEF_TOP_K, step=1, label="Top-k (0 = off)")top_p = gr.Slider(0.05, 1.0, value=DEF_TOP_P, step=0.01, label="Top-p")rep = gr.Slider(1.0, 1.5, value=DEF_REPETITION_PENALTY, step=0.01, label="Repetition penalty")seed = gr.Number(value=DEF_SEED, precision=0, label="Seed (-1 = random)")with gr.Accordion("Model info", open=False):gr.Markdown(f"- **Source:** `{MODEL_SOURCE}`\n- **Parameters:** `{N_PARAMS:,}`\n"f"- **Device / dtype:** `{DEVICE}` / `{str(MODEL_DTYPE).replace('torch.', '')}`\n"f"- **Vocab:** `{CFG.vocab_size:,}` · EOS `{TOK.eos_token}`")inputs = [prompt, max_new, temperature, top_k, top_p, rep, seed]run.click(generate, inputs=inputs, outputs=[output, status])prompt.submit(generate, inputs=inputs, outputs=[output, status])stop.click(lambda: STOP_EVENT.set(), queue=False)return demo, launch_kwargsif __name__ == "__main__":demo, launch_kwargs = build_ui()demo.queue().launch(share=GRADIO_SHARE, server_port=GRADIO_PORT, server_name="0.0.0.0", **launch_kwargs)```</details>Tips: it is a base model, so write the beginning of the text you want rather than a question to achatbot, for example `Sam had 47 marbles. His sister gave him 28 more. Now Sam has`. Lower thetemperature (or set it to 0) for arithmetic; raise it for stories.## EvaluationAll scores are zero-shot on the checkpoint in this repo. The ArithMark benchmarks were scored with
README.md+234-1