Text Generation
Transformers
Safetensors
English
inkling2_loop
image-text-to-text
flintglass
prismcode
inkling-2
coding
python
rlvr
grpo
evalplus
apache-2.0
conversational
modelopt
Instructions to use flintglass/Inkling-2-Mini-PrismCode with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/Inkling-2-Mini-PrismCode with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flintglass/Inkling-2-Mini-PrismCode") 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("flintglass/Inkling-2-Mini-PrismCode") model = AutoModelForMultimodalLM.from_pretrained("flintglass/Inkling-2-Mini-PrismCode", 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 flintglass/Inkling-2-Mini-PrismCode with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/Inkling-2-Mini-PrismCode" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flintglass/Inkling-2-Mini-PrismCode", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flintglass/Inkling-2-Mini-PrismCode
- SGLang
How to use flintglass/Inkling-2-Mini-PrismCode 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 "flintglass/Inkling-2-Mini-PrismCode" \ --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": "flintglass/Inkling-2-Mini-PrismCode", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "flintglass/Inkling-2-Mini-PrismCode" \ --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": "flintglass/Inkling-2-Mini-PrismCode", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flintglass/Inkling-2-Mini-PrismCode with Docker Model Runner:
docker model run hf.co/flintglass/Inkling-2-Mini-PrismCode
Release Flintglass Inkling-2-Mini-PrismCode BF16 part 1 (87.80% HumanEval+ +12.80 pts, 83.32% EvalPlus Macro)
c60a4c3 verified |
Download README.md from flintglass/Inkling-2-Mini-PrismCode: direct link, hf CLI and curl.
- Browser
- Download file 3.7 kB
-
https://huggingface.co/flintglass/Inkling-2-Mini-PrismCode/resolve/main/README.md
- Command line
-
hf download hf://flintglass/Inkling-2-Mini-PrismCode/README.md
-
curl -L -o README.md https://huggingface.co/flintglass/Inkling-2-Mini-PrismCode/resolve/main/README.md
3.7 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| base_model: thinkingmachines/Inkling-2-Mini | |
| tags: | |
| - flintglass | |
| - prismcode | |
| - inkling-2 | |
| - coding | |
| - python | |
| - rlvr | |
| - grpo | |
| - evalplus | |
| - apache-2.0 | |
| # Flintglass Inkling-2-Mini-PrismCode | |
| **Pure On-Policy Execution-Verified Python Coding RLVR on Apache-2.0 `thinkingmachines/Inkling-2-Mini`** — achieving **`87.80%` HumanEval+ (+12.80 pts)**, **`78.84%` MBPP+ (+2.38 pts)**, **`83.32%` EvalPlus Strict Macro Average (+7.59 pts, +30 additional strict EvalPlus tasks solved!)**, and **`-47%` fewer output tokens (1.9× faster!)** with **zero synthetic SFT** and **zero proprietary distillation**. | |
| > **Part of the [Flintglass Prism Open-Source Agent & RAG Stack](https://huggingface.co/collections/flintglass/flintglass-prism-open-agent-and-rag-stack-6b0df22104aefbb7e8d4fe11)** · **GGUF Quantizations:** [`flintglass/Inkling-2-Mini-PrismCode-GGUF`](https://huggingface.co/flintglass/Inkling-2-Mini-PrismCode-GGUF) (`Q4_K_M`, `Q5_K_M`, `Q6_K`) | |
| --- | |
| ## Verified Zero-Leakage EvalPlus Strict Results (542 Tasks) | |
| Evaluated identically with greedy decoding (`temperature=0.0`, `reasoning_effort=0.0`, `max_tokens=1024`) against the full **EvalPlus** strict test suites (80× more edge-case unit tests than standard HumanEval/MBPP): | |
| | Benchmark | Tasks | `Inkling-2-Mini` (Base) | **`flintglass/Inkling-2-Mini-PrismCode`** | Delta | Avg Tokens (Base -> PrismCode) | | |
| |---|---:|---:|---:|---:|---:| | |
| | **HumanEval+ (EvalPlus Strict)** | 164 | 75.00% (123/164) | **87.80% (144/164)** | **+12.80 pts** | 610.0 -> **319.0 (-48%)** | | |
| | **MBPP+ (EvalPlus Strict)** | 378 | 76.46% (289/378) | **78.84% (298/378)** | **+2.38 pts** | 442.8 -> **238.3 (-46%)** | | |
| | **EvalPlus Macro Average** | **542** | **75.73%** | **83.32%** | **+7.59 pts** | **526.4 -> 278.7 (-47%)** | | |
| | **EvalPlus Micro Average** | **542** | **76.01% (412/542)** | **81.55% (442/542)** | **+5.54 pts** | — | | |
| --- | |
| ## How It Was Trained (Pure On-Policy Execution RLVR) | |
| - **Base Model:** `thinkingmachines/Inkling-2-Mini` (Apache-2.0) | |
| - **Algorithm:** PPO-Clipped GRPO (`r=32`, 40 steps, `K=8` rollouts/prompt, 32 prompts/step, cosine LR `3e-5 -> 3e-6`) | |
| - **Live Execution Verifier:** Every single rollout is executed inside an isolated Python subprocess against real unit tests from permissive commercial-safe coding problems (zero overlap with HumanEval+/MBPP+, zero proprietary LLM completions). | |
| - **Reward Shaping:** `+1.00` all unit tests pass, `+0.08` clean code block, `+0.05` concise solution (`<= 240` tokens), `-0.15` Python syntax error. | |
| ## Quickstart (`transformers`) | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "flintglass/Inkling-2-Mini-PrismCode" | |
| tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto", trust_remote_code=True) | |
| messages = [{"role": "user", "content": "Write a Python function `merge_intervals(intervals)` that merges overlapping [start, end] intervals in O(n log n) time."}] | |
| prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, reasoning_effort=0.0) | |
| inputs = tok(prompt, return_tensors="pt").to(model.device) | |
| out = model.generate(**inputs, max_new_tokens=512, do_sample=False) | |
| print(tok.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)) | |
| ``` | |
| ## Local Inference (GGUF / `llama.cpp` / Ollama) | |
| See [`flintglass/Inkling-2-Mini-PrismCode-GGUF`](https://huggingface.co/flintglass/Inkling-2-Mini-PrismCode-GGUF) for verified `Q4_K_M`, `Q5_K_M`, and `Q6_K` quantizations. | |
| **License:** Apache-2.0 | |