Instructions to use RecursiveSI/flint-v1.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RecursiveSI/flint-v1.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RecursiveSI/flint-v1.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RecursiveSI/flint-v1.1") model = AutoModelForCausalLM.from_pretrained("RecursiveSI/flint-v1.1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RecursiveSI/flint-v1.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RecursiveSI/flint-v1.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RecursiveSI/flint-v1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RecursiveSI/flint-v1.1
- SGLang
How to use RecursiveSI/flint-v1.1 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 "RecursiveSI/flint-v1.1" \ --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": "RecursiveSI/flint-v1.1", "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 "RecursiveSI/flint-v1.1" \ --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": "RecursiveSI/flint-v1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RecursiveSI/flint-v1.1 with Docker Model Runner:
docker model run hf.co/RecursiveSI/flint-v1.1
Commit ·
db1fdc0
0
Parent(s):
Release Recursive Flint 1.1
Browse filesFiles changed (39)
- .gitattributesAdded+40
- LICENSEAdded+201
- README.mdAdded+117
- assets/flint-logo.pngAdded
- assets/flint_1.1_benchmarks.pngAdded
- assets/flint_1.1_quantization.pngAdded
- assets/flint_1.1_tool_calling.pngAdded
- chat_template.jinjaAdded+61
- config.jsonAdded+115
- generation_config.jsonAdded+14
- model-00001-of-00015.safetensorsAdded+3
- model-00002-of-00015.safetensorsAdded+3
- model-00003-of-00015.safetensorsAdded+3
- model-00004-of-00015.safetensorsAdded+3
- model-00005-of-00015.safetensorsAdded+3
- model-00006-of-00015.safetensorsAdded+3
- model-00007-of-00015.safetensorsAdded+3
- model-00008-of-00015.safetensorsAdded+3
- model-00009-of-00015.safetensorsAdded+3
- model-00010-of-00015.safetensorsAdded+3
- model-00011-of-00015.safetensorsAdded+3
- model-00012-of-00015.safetensorsAdded+3
- model-00013-of-00015.safetensorsAdded+3
- model-00014-of-00015.safetensorsAdded+3
- model-00015-of-00015.safetensorsAdded+3
- model.safetensors.index.jsonAdded
- sglang/DockerfileAdded+14
- sglang/NOTICEAdded+41
- sglang/README.mdAdded+202
- sglang/example_client.pyAdded+71
- sglang/example_tools.pyAdded+178
- sglang/fa4-learned-sink-fix.patchAdded+101
- sglang/flint_sglang-0.1.4-py3-none-any.whlAdded
- sglang/install.shAdded+69
- sglang/serve_b300.shAdded+39
- sglang/serve_h200.shAdded+38
- sglang/serve_node_8x.shAdded+25
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+1295
12345678910111213141516171819202122232425262728293031323334353637383940*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/flint-logo.png filter=lfs diff=lfs merge=lfs -textassets/flint_1.1_benchmarks.png filter=lfs diff=lfs merge=lfs -textassets/flint_1.1_quantization.png filter=lfs diff=lfs merge=lfs -textassets/flint_1.1_tool_calling.png filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117---license: apache-2.0library_name: transformerspipeline_tag: text-generation---
<p align="center"> <img src="assets/flint-logo.png" width="160" alt="Flint logo"></p>
<h1 align="center">Recursive Flint 1.1</h1>
<p align="center"> <a href="https://huggingface.co/RecursiveSI">Hugging Face</a> | <a href="https://github.com/recursive-oss/rec">Local engine</a> | <a href="https://docs.recursive.com/getting-started">Documentation</a></p>
Flint 1.1 is an updated release of Recursive’s mixture-of-experts language model for coding agents, with 39.8 billion total parameters and approximately 2.5 billion active per token. It is designed to investigate codebases, fix bugs, implement features, and write tests.
Flint 1.1 supports text input and output, reasoning, and multi-turn tool use. Compared with Flint, it improves agentic coding, tool use, and cross-harness generalization—scoring 64.5% on Terminal-Bench 2.1, 91.5% on SWE-bench Pro v2, 76.6% on SWE-bench Verified, 66.8% on MCP-Atlas (filtered), 66.6% on WideSearch, and 96.2% on IFEval—while sharply reducing tool-call errors across coding-agent harnesses and preserving accuracy under 4-bit quantization.
This repository contains the BF16 checkpoint, model configuration, tokenizer, chat template, and an SGLang serving kit. Quantized variants are prepared separately for NVIDIA and Apple Silicon runtimes.
## Evaluation

Flint 1.1 results use temperature 1.0, top-p 0.95, and top-k 20. Terminal-Bench 2.1 uses Terminus 2 (counting solutions obtained through web retrieval as unsuccessful); SWE-bench uses mini-swe-agent. Terminal-Bench 2.1, SWE-bench Pro v2, SWE-bench Verified, and IFEval report mean pass@1 over 5 attempts; MCP-Atlas reports pass@0.75 on the 407/500 filtered subset without broken tasks; WideSearch reports Item F1.
### Tool-calling generalization

Across six coding-agent harnesses (200 coding tasks each, single attempt), Flint 1.1 maintains high solve rates (91.0%–93.5%) while reducing unexecutable tool-call errors to ≤0.4% across Pi, Mini-SWE-Agent (default and renamed tool arguments), Claude Code, Cline, and Codex.
### Quantization robustness

Averaged across the six coding-agent harnesses (200 tasks each, single attempt), 4-bit NVFP4 quantization (simulated in BF16) reduces solve rate by 1.2 points on Flint 1.1 (92.0% → 90.8%) compared with 3.4 points on Flint (81.6% → 78.2%), with near-zero tool-call errors (0.1% BF16, 0.0% 4-bit).
## Model specifications
| Property | Flint 1.1 || :---- | :---- || Developer | Recursive || Architecture | Decoder-only mixture-of-experts Transformer || Total parameters | 39.8B || Active parameters per token | Approximately 2.5B, including the output head¹ || Layers | 49: 2 dense layers followed by 47 MoE layers || Attention | 35 sliding-window layers and 14 full-attention layers || Sliding window | 513 tokens: the current token and 512 preceding tokens || Attention heads | 32 query heads and 4 key/value heads; head dimension 128 || Attention normalization | Per-head QK RMSNorm and learned per-head attention sinks || Position encoding | RoPE on sliding-window layers; no positional encoding on full-attention layers || Experts per MoE layer | 256 routed experts, with 6 selected per token, plus an always-active shared expert || Documented context configuration | 262,144 tokens, including prompt and generated output || Vocabulary | 150,144 tokens || Input / output | Text / text || Stated knowledge cutoff | June 2026 |
¹ The active-parameter convention includes the output head and excludes the full input embedding matrix. The active body alone is approximately 2.2B parameters. “40B-A2.5B” is the rounded model-size designation.
## Getting started
Flint 1.1 runs on one B300 or H200 GPU per replica with the SGLang kit in `sglang/`. Transformers modeling code is not included yet.
```bashpip install -U huggingface_hub openaihf download RecursiveSI/flint-v1.1 --local-dir flint-v1.1 && cd flint-v1.1 # about 80 GBdocker build -t flint-sglang sglangdocker run -d --name flint --gpus '"device=0"' --ipc=host -p 127.0.0.1:30000:30000 \ -v "$PWD:/model" -e MODEL=/model flint-sglang bash /model/sglang/serve_b300.sh # H200: serve_h200.shuntil curl -sf localhost:30000/health_generate >/dev/null; do sleep 15; done # progress: docker logs -f flintpython3 sglang/example_client.py --base-url http://localhost:30000/v1 # reasoning and a tool call```
```pythonfrom openai import OpenAI
client = OpenAI(base_url="http://localhost:30000/v1", api_key="unused")response = client.chat.completions.create( model="flint", messages=[{"role": "user", "content": "Write a Python function that merges overlapping intervals."}], max_tokens=32768,)print(response.choices[0].message.content)```
[`sglang/README.md`](sglang/README.md) covers requirements, serve-script options, multi-GPU deployments, and API details.
### Recommended generation settings
| Setting | Value || :---- | :---- || Temperature | 1.0 || Top-p / top-k | 0.95 / 20 || Output budget for hard problems | At least 32768 tokens, including reasoning |
The server applies these sampling settings when a request omits them. Flint 1.1 supports OpenAI-compatible tool calls. Use the checkpoint’s chat template and preserve returned `reasoning_content` in conversation history. Prompt and output share the context window.
## Training
Flint 1.1 uses the same pretrained base model as [Flint](https://huggingface.co/RecursiveSI/flint) and is a newly post-trained model.
## Limitations and responsible use
Flint 1.1’s supervised fine-tuning included safety-oriented examples, but the model can still produce incorrect or harmful content, faulty code, or inappropriate tool calls. Test generated code and review consequential changes before applying them. Tool-using applications should enforce their own permissions and execution boundaries; structured tool-call grammar does not prevent the model from choosing an unsafe or incorrect action.
Long reasoning can increase latency and exhaust the output budget before an answer is complete. The context configuration is a capacity limit, not a guarantee of uniform accuracy across all sequence lengths or tasks. Results can vary with checkpoint precision and inference runtime; evaluate the specific checkpoint and runtime you intend to deploy.
## License and reporting
Flint 1.1 is released under the [Apache 2.0 license](LICENSE). Hosted API terms and data practices are separate from the weight license.
For model and serving issues, contact support@recursive.com and include the checkpoint revision, runtime version, hardware, launch command, and a minimal reproduction. Report safety concerns or suspected misuse to safety@recursive.com, and security vulnerabilities to security@recursive.com.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061{%- macro flint_text(t) -%}{%- if t is string -%}{{- t | replace("\x00", "") | replace("<think>", "") | replace("</think>", "") | replace("<|begin_of_text|>", "<|begin_of_text|>") | replace("<|end_of_text|>", "<|end_of_text|>") | replace("<|system|>", "<|system|>") | replace("<|developer|>", "<|developer|>") | replace("<|user|>", "<|user|>") | replace("<|assistant|>", "<|assistant|>") | replace("<|observation|>", "<|observation|>") -}}{%- else -%}{{- t -}}{%- endif -%}{%- endmacro -%}{%- set tool_preamble -%}{%- if tools %}<|system|># Tools
You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:<tools>{%- for tool in tools %}{%- set fn = tool.function if tool.function is defined else tool %}{{ fn | tojson(ensure_ascii=False) }}{%- endfor %}</tools>
For each function call, output the function name and arguments within the following XML format:<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value>...</tool_call>{% endif -%}{%- endset -%}{%- set ns = namespace(tools_pending=true) -%}{%- for m in messages -%}{%- if ns.tools_pending and m.role != 'system' -%}{{ tool_preamble }}{%- set ns.tools_pending = false -%}{%- endif -%}{%- if m.role == 'system' -%}<|system|>{{ flint_text(m.content) }}{%- elif m.role == 'developer' -%}<|developer|>{{ flint_text(m.content) }}{%- elif m.role == 'user' -%}<|user|>{{ flint_text(m.content) }}{%- elif m.role == 'assistant' -%}<|assistant|>{%- if m.reasoning_content %}<think>{{ m.reasoning_content }}</think>{% endif -%}{%- if m.content %}{{ m.content }}{% endif -%}{%- if m.tool_calls -%}{%- for tc in m.tool_calls -%}{%- set fn = tc.function if tc.function is defined else tc -%}<tool_call>{{ fn.name }}{%- for k, v in fn.arguments.items() -%}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{%- endfor -%}</tool_call>{%- endfor -%}{%- endif -%}{%- elif m.role == 'tool' -%}<|observation|><tool_response>{{ flint_text(m.content) }}</tool_response>{%- endif -%}{%- endfor -%}{%- if ns.tools_pending -%}{{ tool_preamble }}{%- endif -%}{%- if add_generation_prompt -%}<|assistant|>{%- endif -%}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115{ "architectures": [ "FlintForCausalLM" ], "model_type": "flint", "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": 150000, "decoder_sparse_step": 1, "eos_token_id": [ 150001, 150003, 150005, 150018 ], "head_dim": 128, "hidden_act": "silu", "hidden_size": 2048, "initializer_range": 0.02, "intermediate_size": 6144, "layer_types": [ "full_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "full_attention" ], "max_position_embeddings": 262144, "mlp_only_layers": [ 0, 1 ], "moe_intermediate_size": 512, "norm_topk_prob": true, "num_attention_heads": 32, "num_experts": 256, "num_experts_per_tok": 6, "num_hidden_layers": 49, "num_key_value_heads": 4, "no_rope_layer_indices": [ 0, 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 48 ], "output_router_logits": false, "pad_token_id": 150001, "rms_norm_eps": 1e-06, "rope_theta": 10000.0, "router_aux_loss_coef": 0.0005, "router_score_function": "sigmoid", "shared_expert_intermediate_size": 1024, "sliding_window": 513, "softmax_type": "learnable", "tie_word_embeddings": false, "torch_dtype": "bfloat16", "use_cache": true, "use_sliding_window": true, "vocab_size": 150144, "transformers_version": "5.12.1"}1234567891011121314{ "bos_token_id": 150000, "eos_token_id": [ 150001, 150003, 150005, 150018 ], "pad_token_id": 150001, "do_sample": true, "temperature": 1.0, "top_p": 0.95, "top_k": 20}123version https://git-lfs.github.com/spec/v1oid sha256:f43c810f1ae06f1d5e12049380cbdff5d99f10fecb1af06263fc05eab4e8a264size 5368494400123version https://git-lfs.github.com/spec/v1oid sha256:019cfbeaee7a36b0acbc1bee2abed09856e11d47c76ef85da19cfa120b6ab20bsize 5367998528123version https://git-lfs.github.com/spec/v1oid sha256:dcb8209cb786183986a248c049e93d298df5c54504a3b1e5b275c0467c8141b2size 5366957800123version https://git-lfs.github.com/spec/v1oid sha256:ee929975627090bc363cf6306b1fa077fa04bed4e24f5b53ee24b713ff95ea56size 5368000848123version https://git-lfs.github.com/spec/v1oid sha256:85a55afe70fab889672ced9ee21b531f3b1cee5a316e1cdaf7c1067aa3ac44bdsize 5368000928123version https://git-lfs.github.com/spec/v1oid sha256:3d4dcb0d3f03ce3f222d55f75cfedb321dd0cdbf539b8347bc87e176279bf484size 5368000976123version https://git-lfs.github.com/spec/v1oid sha256:32a75de8b728df5d770194582cb5d5bbff2682243428a697f9536851ef305641size 5366959544123version https://git-lfs.github.com/spec/v1oid sha256:1c10f15445e6d53b1002df583cc270b7691986441833da76baec4f2429a94896size 5368000784123version https://git-lfs.github.com/spec/v1oid sha256:159298da82fc74ae5266e016bcdec79f62b4b1204d74a06992c80416cefe0d60size 5368000928123version https://git-lfs.github.com/spec/v1oid sha256:aa48cc8f35b330aecc29c44926fa208475882288536ca9516001a998ec0b2022size 5368000920123version https://git-lfs.github.com/spec/v1oid sha256:9387d319e05245f04de359d69c1fc9f78dbe5b03e063257ed625ea868fbdb0dbsize 5353323280123version https://git-lfs.github.com/spec/v1oid sha256:d8cf3ed7252b0f15a9168b40c134d03fe9f8025c5aa5013cc605f287bf43652bsize 5366956200123version https://git-lfs.github.com/spec/v1oid sha256:f71e96e0811719562425adfea4765d9f7b809b4d5a01bd997e5bfc94c57d0917size 5368000896123version https://git-lfs.github.com/spec/v1oid sha256:d85d43abcd77f54734d8eaf81ec9daea8d00760a79bd01f9eba5c9a9094f779asize 5368000920123version https://git-lfs.github.com/spec/v1oid sha256:4ce905793b41937c4687d067a2e9ace64352781efee250a0c46153bb8e696492size 44404411121234567891011121314# Flint serving image: SGLang v0.5.16 + the flint_sglang model package + the FA4 learned-sink fix.# Build from the directory that contains this file, install.sh, the flint_sglang wheel and the patch:# docker build -t flint-sglang .# Host requirement: NVIDIA driver >= 580 (CUDA 13), or CUDA forward compatibility on older# datacenter drivers (the image ships it in /usr/local/cuda/compat).# lmsysorg/sglang:v0.5.16-cu130 (multi-arch index digest the kit was validated with)FROM lmsysorg/sglang@sha256:7b6a35df9839fd593a94a1eaee82d7777f472225d9f3ad1f8a2e0cb2bd1785d0
COPY install.sh fa4-learned-sink-fix.patch flint_sglang-*.whl /tmp/flint-build/RUN bash /tmp/flint-build/install.sh /tmp/flint-build && rm -rf /tmp/flint-build
ENV FLASHINFER_VERSION=0.6.16.post1 \ SGLANG_EXTERNAL_MODEL_PACKAGE=flint_sglang \ FLASHINFER_USE_CUDA_NORM=11234567891011121314151617181920212223242526272829303132333435363738394041flint_sglang builds on SGLang (https://github.com/sgl-project/sglang).Copyright 2023-2024 SGLang Team. Licensed under the Apache License, Version 2.0 (see LICENSE).Portions of flint_sglang/model.py are adapted from SGLang and modified.
fa4-learned-sink-fix.patch modifies the FlashAttention-4 kernel vendored in SGLang(https://github.com/Dao-AILab/flash-attention). It fixes learned-sink normalization and includesthe TMEM-allocation barrier change from Dao-AILab/flash-attention#2913. That code is distributedunder the following license:
BSD 3-Clause License
Copyright (c) 2022, the respective contributors, as shown by the AUTHORS file.All rights reserved.
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
install.sh downloads third-party packages at build time (including nvidia-cutlass-dsl, distributedunder the NVIDIA Software License Agreement); they are governed by their own licenses.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202# Serving Flint with SGLang
This directory is Flint's serving kit for SGLang 0.5.16: the `flint_sglang` model package (a wheel), aDockerfile, `install.sh` for existing containers, the FA4 learned-sink patch, serve scripts and twoexample clients. The commands below pin a commit of this repository.
Flint reasons at length on hard problems (see `max_tokens` below).
## Quick start (Docker, one GPU)
Requirements:- One GPU with ≥141 GB per replica: B300/B200 (Blackwell) or H200 (Hopper). 80 GB GPUs are not supported.- NVIDIA driver ≥ 580 (CUDA 13). Older datacenter drivers (e.g. R570) work through the CUDA forward-compatibility libraries in the image (`/usr/local/cuda/compat`), which recent NVIDIA Container Toolkit and enroot setups pick up automatically. Tested: B300 with 580.126.20, H200 with 570.133.20.- Building the image needs access to Docker Hub, pypi.org/files.pythonhosted.org, flashinfer.ai and github.com (FlashInfer release assets).- About 80 GB of disk for the weights plus about 50 GB for the image.
```bashpip install -U huggingface_hub openaiREV=$(python3 -c "from huggingface_hub import HfApi; print(HfApi().model_info('RecursiveSI/flint-v1.1').sha)")hf download RecursiveSI/flint-v1.1 --revision "$REV" --local-dir "flint-v1.1-$REV"cd "flint-v1.1-$REV" && hf cache verify RecursiveSI/flint-v1.1 --revision "$REV" --local-dir . # verify the downloaddocker build -t "flint-sglang:${REV:0:12}" sglangdocker run -d --name flint --gpus '"device=0"' --ipc=host -p 127.0.0.1:30000:30000 \ -v "$PWD:/model" -e MODEL=/model "flint-sglang:${REV:0:12}" \ bash /model/sglang/serve_b300.sh # on H200: serve_h200.shuntil curl -sf localhost:30000/health_generate >/dev/null; do sleep 15; done # progress: docker logs -f flintpython3 sglang/example_client.py --base-url http://localhost:30000/v1python3 sglang/example_tools.py --base-url http://localhost:30000/v1 # nested tool arguments, parallel calls```
The first start takes about 4 minutes on a B300 with the weights on fast local storage (longer whenmany replicas read the weights from network storage at once; budget up to 15 minutes). The logshows `Flint weights loaded: 585 parameters matched the checkpoint.` and then`The server is fired up and ready to roll!`. `example_client.py` prints the reasoning, a`get_weather` call for Paris, and a final answer that uses the tool result (sunny, 21C).`example_tools.py` books a meeting and fills a cart through tools with nested argument schemas(enums, patterns, bounds, arrays of objects) and makes three parallel weather calls. It answers eachcall with a canned result, which Flint's final answers report.
## Serve scripts
Requests use the model name `flint`. Arguments after the script name are appended to`sglang.launch_server`, so a repeated flag overrides the script's value, e.g.`bash /model/sglang/serve_b300.sh --mem-fraction-static 0.85`.
| Variable | Default | Notes ||---|---|---|| `MODEL` | `RecursiveSI/flint-v1.1` | Use the local download (`/model` in Docker). With the Hub id the server downloads 79.6 GB at start-up. || `REVISION` | unset | Hub commit when `MODEL` is a Hub id (ignored for local paths). || `PORT` | `30000` | Replica port. || `CUDA_VISIBLE_DEVICES` | all GPUs | GPU of a single replica (the server uses the first visible GPU). || `FLINT_TRITON_CACHE_BASE` | `$HOME/.triton/cache` | Kernel cache root; each replica uses its own `flint-<host>-<port>` subdirectory. Mount a volume here to keep compiled kernels across container restarts. |
The servers listen on 0.0.0.0 without authentication: publish ports only on localhost or a privatenetwork, or append `--api-key <key>` and give clients the same key.
## Validated configurations
One GPU per replica:- B300 (x86_64): `serve_b300.sh` (`--attention-backend fa4 --moe-runner-backend flashinfer_trtllm_routed`). B200 and GB200/GB300 (arm64) use the same flags but are not validated yet.- H200: `serve_h200.sh` (`--attention-backend fa3 --moe-runner-backend triton`).
Both use `--enable-fp32-lm-head --context-length 262144`. The other settings are those Flint wasevaluated with on each GPU type (B300: `--mem-fraction-static 0.8 --swa-full-tokens-ratio 0.05`;H200: `0.9` / `0.4`).
The model refuses to start with a MoE runner other than `flashinfer_trtllm_routed`, `triton` or`auto` (`flashinfer_trtllm` and `triton_kernel` bypass Flint's sigmoid routing), with any`--moe-a2a-backend`, with an unpatched FA4 kernel, or if FlashInfer does not use its CUDA RMSNormkernels (`FLASHINFER_USE_CUDA_NORM=1`, which the image and `flint_sglang` set). `--attention-backendflashinfer` does not support attention sinks. Tensor, expert or pipeline parallelism, DP attention,quantized weights or KV cache (e.g. FP8) and speculative decoding are not validated.
## Several replicas behind a router
Replicas are independent single-GPU servers; the router (`sglang_router` 0.3.2, included in theimage) spreads requests over them.
```bash# 8 replicas on one 8-GPU node, ports 30000-30007 (Blackwell; on H200 add -e SERVE_SCRIPT=serve_h200.sh)docker run -d --name flint-8x --gpus all --ipc=host -p 30000-30007:30000-30007 \ -v "$PWD:/model" -e MODEL=/model "flint-sglang:${REV:0:12}" bash /model/sglang/serve_node_8x.sh# router on any host that can reach every replicadocker run -d --name flint-router --network host "flint-sglang:${REV:0:12}" \ python3 -m sglang_router.launch_router --host 0.0.0.0 --port 8000 --policy cache_aware \ --worker-urls $(for n in node0 node1; do for p in $(seq 30000 30007); do printf 'http://%s:%d ' $n $p; done; done)```
`serve_node_8x.sh` stops all 8 replicas when one exits; for independent restarts run one containerper GPU instead (`--gpus '"device=N"'`, `-e PORT=3000N`).
## Existing container (no image build), e.g. enroot/pyxis
Inside a container of the base image pinned in `sglang/Dockerfile` (`lmsysorg/sglang:v0.5.16-cu130`),with network access:
```bashbash flint-v1.1-$REV/sglang/install.sh flint-v1.1-$REV/sglang # ends with: Flint support installed (flint_sglang-0.1.4-py3-none-any.whl).MODEL=$PWD/flint-v1.1-$REV PORT=30000 bash flint-v1.1-$REV/sglang/serve_h200.sh # Blackwell: serve_b300.sh```
`install.sh` changes the container in place (FlashInfer 0.6.16.post1, CUTLASS DSL 4.6.2, the patchedFA4 kernel, `flint_sglang`), can be re-run, and works without root if the container's system Pythonis writable (enroot/pyxis containers are). Keep or save that container (pyxis:`--container-save=flint-sglang.sqsh`); a fresh copy of the base image has no Flint support. On H200the FA4 patch is applied but unused.
## Capacity and tuning
- KV cache per token: 28 KiB on the 14 full-attention layers (≈7.5 GB for one 262,144-token sequence) plus 70 KiB on the 35 sliding-window layers, which keep only the last 513 tokens of each running request.- `--mem-fraction-static` is the share of GPU memory for the weights (79.6 GB) plus the KV pools.- `--swa-full-tokens-ratio` sizes the sliding-window pool relative to the full-attention pool: raise it for many concurrent short requests, lower it for few long ones.
## Chat format and API usage
Tool definitions appear after leading system messages, before the first developer or other role.
- Use `/v1/chat/completions` with the parsers and grammar backend in the serve scripts (`--tool-call-parser flint --reasoning-parser flint --grammar-backend flint`). Flint refuses to start without `--grammar-backend flint` and `--reasoning-parser flint`, or with `--enable-strict-thinking` or `--constrained-json-disable-any-whitespace`, which that backend doesn't support. Without a tool-call parser, tool calls stay as literal `<tool_call>` text in `content`.- Tool-call grammar: `--tool-call-parser flint` parses Flint's tool calls and constrains every request with `tools` (unless `tool_choice` is `none`) with XGrammar to Flint's format: an optional `<think>…</think>` (from `--grammar-backend flint`), text without protocol markers, then tool calls to the request's tools: any number with `tool_choice` `auto`, at least one with `required`, exactly one call of the named function with a named choice. As in OpenAI's API, a tool's arguments must match its JSON schema only when the tool is sent with `"strict": true`; they are then also written in the order the tool declares its parameters (list optional parameters where they belong). Follow OpenAI's strict-mode rules: give every object `properties` or `additionalProperties` and every array `items` (otherwise XGrammar accepts no value for the object and only `[]` for the array); a strict schema XGrammar can't compile (for example a pattern with a lookahead) fails the request. Other tools keep the call format but not their schema. `parallel_tool_calls: false` allows a single call. The turn still ends with Flint's stop tokens.- Tool-call limits: - A strict string value (an enum, `const`, `pattern`, `format` or `maxLength`) written with whitespace around it fails its schema: XGrammar allows the whitespace and the parser keeps it. Flint rarely does this; it has been seen on a prompt that asks it to print a tool call as text. - A string argument can't contain the literal text `</tool_call>`. The format has no escaping, so the parser ends the call there and reads the rest as output: text Flint copies into an argument can add a call, without arguments, to a listed tool. - When streaming, a call whose last argument is a JSON object can arrive without its final `}`. SGLang adds it back only for the response's last call. - With `tool_choice: "none"` nothing is constrained, so call markup Flint writes can reach `content`.- Structured output: `response_format` (`json_schema`, `json_object` or `structural_tag`) and SGLang's `regex` and `ebnf` parameters constrain `content`. Flint may first reason in `<think>…</think>` (returned in `reasoning_content`), and the constraint applies to the answer after it. A request with both `tools` and a response format gets only the response format, and `<tool_call>` text in the answer is still read as a tool call. Use `/v1/chat/completions`: `/generate` and `/v1/completions` return Flint's raw text, including any `<think>…</think>` written before a constrained answer.- Sampling: temperature 1.0, top_p 0.95, top_k 20. These are the `generation_config.json` defaults the server applies when a request omits them; OpenAI clients pass `top_k` via `extra_body`. Greedy decoding is not validated.- Reasoning: the model decides on each turn whether to reason in `<think>…</think>` (there is no switch or budget). Reasoning is returned in `reasoning_content` and counts toward `max_tokens`: on GPQA-Diamond it used a median of 4.3K tokens (p95 33K, p99 46K; about 5% of answers exceed 32K). Use `max_tokens` of at least 32768 for hard problems (Flint was evaluated with up to 81920); `finish_reason: "length"` means the turn was cut off, possibly before any content or tool call. Keep `reasoning_content` on assistant messages when you send the conversation back. `thinking` / `enable_thinking` in `chat_template_kwargs` have no effect: the `flint` reasoning parser reads `<think>…</think>` when Flint writes it and never assumes a turn starts in reasoning, so turns without reasoning keep their content and their tool-call grammar.- Messages: content must be a string (flatten content-part arrays). A `developer` message uses its own `<|developer|>` role marker (token ID 150018). There is no default system prompt. As in training, the template removes NUL characters and `<think>`/`</think>` from system, developer, user and tool text and escapes role markers there (`<|user|>` becomes `<|user|>`). It does not escape the tool tags (`<tool_call>`, `<tool_response>`, `<arg_key>`, `<arg_value>`); strip those from untrusted tool output.- Tools: send `tools` with every request. Each function definition is rendered as the template receives it; through the server that is `description`, `name`, `parameters` and `strict` (other fields are dropped). Send `function.arguments` back unchanged (the JSON string you received) and one `tool` message per call, in the order of `tool_calls`. When calling `apply_chat_template` directly, decode argument strings into dictionaries first.- Generation stops at `<|end_of_text|>`, `<|user|>`, `<|observation|>` or `<|developer|>` (ids 150001, 150003, 150005, 150018). No BOS token is used for chat.
## Versions and verification
- Quote the full commit SHA (`$REV`) in results and bug reports. Download each commit into a new directory (`hf download` does not delete files removed upstream).- Serving kit: SGLang 0.5.16 (base image pinned by digest in `sglang/Dockerfile`; includes transformers 5.12.1, torch 2.11.0+cu130, sglang-router 0.3.2), `flint_sglang` 0.1.4, FlashInfer 0.6.16.post1, nvidia-cutlass-dsl 4.6.2, quack-kernels 0.6.4, apache-tvm-ffi 0.1.12.
When reporting a problem, include the commit SHA, the image ID (`docker inspect --format '{{.Id}}'flint-sglang:<tag>`), `nvidia-smi` output, the launch command including extra arguments, the start-uplog and, for output problems, the request JSON and the raw response.
## Transformers
The tokenizer and chat template load with `AutoTokenizer.from_pretrained`; decode each`tool_calls[].function.arguments` string into a dict before `apply_chat_template`. Transformers doesnot support Flint yet, so `config.json` loads with `FlintConfig.from_pretrained` from`flint_sglang.configuration_flint` (transformers ≥ 5.8, tested with 5.12.1) rather than `AutoConfig`.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071"""Minimal OpenAI-compatible client for a Flint SGLang server, with one tool-calling round trip.
pip install openai python3 example_client.py --base-url http://localhost:30000/v1 [--api-key KEY]"""
import argparseimport jsonimport os
from openai import OpenAI
SAMPLING = {"temperature": 1.0, "top_p": 0.95, "extra_body": {"top_k": 20}}MAX_TOKENS = 32768 # reasoning counts toward max_tokens
TOOLS = [ { "type": "function", "function": { "name": "get_weather", "description": "Get the current weather for a city.", "parameters": { "type": "object", "properties": {"city": {"type": "string", "description": "City name"}}, "required": ["city"], }, }, }]
def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--base-url", default="http://localhost:30000/v1") parser.add_argument("--api-key", default=os.environ.get("FLINT_API_KEY", "unused")) args = parser.parse_args() client = OpenAI(base_url=args.base_url, api_key=args.api_key)
messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What's the weather in Paris right now?"}, ] first = client.chat.completions.create( model="flint", messages=messages, tools=TOOLS, max_tokens=MAX_TOKENS, **SAMPLING ) choice = first.choices[0] reply = choice.message print("reasoning:", getattr(reply, "reasoning_content", None)) print("tool calls:", reply.tool_calls) if choice.finish_reason == "length": print(f"cut off: the turn used all {MAX_TOKENS} tokens (reasoning counts toward max_tokens)") return if not reply.tool_calls: print("content:", reply.content) return
# Echo the assistant turn (including reasoning_content) back unchanged, then add tool results. messages.append(reply.model_dump(exclude_none=True)) for call in reply.tool_calls: city = json.loads(call.function.arguments)["city"] messages.append( {"role": "tool", "tool_call_id": call.id, "content": json.dumps({"city": city, "forecast": "sunny, 21C"})} ) second = client.chat.completions.create( model="flint", messages=messages, tools=TOOLS, max_tokens=MAX_TOKENS, **SAMPLING ) print("final answer:", second.choices[0].message.content)
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178"""Tool calls with nested argument schemas against a Flint SGLang server.
pip install openai python3 example_tools.py --base-url http://localhost:30000/v1 [--api-key KEY]
The serve scripts start SGLang with --tool-call-parser flint, which constrains each assistant turn thathas tools to Flint's tool-call format: tool names must be ones the request lists, and the arguments of atool sent with "strict": true must match its JSON schema (types, enums, patterns, numeric bounds,required fields). The tools below send "strict": true; other tools keep the format but not the schema.Each call gets a canned result (tool_result below), which Flint's final answers report."""
import argparseimport jsonimport os
from openai import OpenAI
SAMPLING = {"temperature": 1.0, "top_p": 0.95, "extra_body": {"top_k": 20}}MAX_TOKENS = 32768 # reasoning counts toward max_tokensTIME = {"type": "string", "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"}WEATHER = {"paris": ("sunny", 21), "tokyo": ("cloudy", 17), "lima": ("light rain", 19)} # canned (conditions, °C)
TOOLS = [ { "type": "function", "function": { "name": "create_event", "strict": True, "description": "Create a calendar event.", "parameters": { "type": "object", "properties": { "title": {"type": "string"}, "date": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", "description": "YYYY-MM-DD"}, "start_time": {**TIME, "description": "24-hour HH:MM"}, "duration_minutes": {"type": "integer", "minimum": 5, "maximum": 480}, "attendees": { "type": "array", "minItems": 1, "items": { "type": "object", "properties": {"name": {"type": "string"}, "email": {"type": "string"}}, "required": ["name", "email"], "additionalProperties": False, }, }, "reminders_minutes": {"type": "array", "items": {"type": "integer", "minimum": 0}}, "priority": {"type": "string", "enum": ["LOW", "NORMAL", "HIGH_PRIORITY"]}, }, "required": ["title", "date", "start_time", "duration_minutes", "attendees", "priority"], "additionalProperties": False, }, }, }, { "type": "function", "function": { "name": "add_to_cart", "strict": True, "description": "Add products to the shopping cart.", "parameters": { "type": "object", "properties": { "items": { "type": "array", "minItems": 1, "items": { "type": "object", "properties": { "sku": {"type": "string", "pattern": "^[A-Z]{3}-[0-9]{4}$"}, "quantity": {"type": "integer", "minimum": 1, "maximum": 99}, "gift_wrap": {"type": "boolean"}, }, "required": ["sku", "quantity", "gift_wrap"], "additionalProperties": False, }, }, "coupon": {"type": "string", "description": "Coupon code; omit when there is none"}, }, "required": ["items"], "additionalProperties": False, }, }, }, { "type": "function", "function": { "name": "get_weather", "strict": True, "description": "Get the current weather for a city.", "parameters": { "type": "object", "properties": { "city": {"type": "string"}, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}, }, "required": ["city", "unit"], "additionalProperties": False, }, }, },]
REQUESTS = [ "Book 'Q4 planning' on October 21st, 2026 at 2:30 PM for 45 minutes with Ana (ana@example.com) and Bo " "(bo@example.com). Remind us 10 minutes and one hour before. It is urgent.", "Add two gift-wrapped mugs (SKU MUG-0042) and one notebook (SKU NTB-1001, no gift wrap) to my cart. No coupon.", "What's the weather in Paris, Tokyo and Lima? Use celsius.",]
def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--base-url", default="http://localhost:30000/v1") parser.add_argument("--api-key", default=os.environ.get("FLINT_API_KEY", "unused")) args = parser.parse_args() client = OpenAI(base_url=args.base_url, api_key=args.api_key) for request in REQUESTS: run(client, request)
def run(client: OpenAI, request: str) -> None: print(f"\n>>> {request}") messages = [{"role": "user", "content": request}] choice = client.chat.completions.create( model="flint", messages=messages, tools=TOOLS, max_tokens=MAX_TOKENS, **SAMPLING ).choices[0] if choice.finish_reason == "length": print(f"cut off: the turn used all {MAX_TOKENS} tokens (reasoning counts toward max_tokens)") return reply = choice.message if not reply.tool_calls: print("content:", reply.content) return for call in reply.tool_calls: print(f"{call.function.name}:", json.dumps(json.loads(call.function.arguments), ensure_ascii=False))
# Echo the assistant turn back unchanged, answer every call, and let Flint finish the turn. messages.append(reply.model_dump(exclude_none=True)) for call in reply.tool_calls: result = tool_result(call.function.name, json.loads(call.function.arguments)) print(f"{call.function.name} result:", json.dumps(result, ensure_ascii=False)) messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)}) final = client.chat.completions.create( model="flint", messages=messages, tools=TOOLS, max_tokens=MAX_TOKENS, **SAMPLING ) print("final answer:", final.choices[0].message.content)
def tool_result(name: str, arguments: dict) -> dict: """Canned result for one call, standing in for a real calendar, shop and weather service.""" if name == "get_weather": conditions, celsius = WEATHER.get(arguments["city"].lower(), ("clear", 20)) temperature = celsius if arguments["unit"] == "celsius" else round(celsius * 9 / 5 + 32) return { "city": arguments["city"], "conditions": conditions, "temperature": temperature, "unit": arguments["unit"], } if name == "create_event": return { "status": "created", "event_id": "evt_1042", "title": arguments["title"], "date": arguments["date"], "start_time": arguments["start_time"], } return { "status": "added", "cart_id": "cart_77", "items_added": sum(item["quantity"] for item in arguments["items"]), }
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101--- a/python/sglang/jit_kernel/flash_attn/cute/flash_fwd_sm100.py+++ b/python/sglang/jit_kernel/flash_attn/cute/flash_fwd_sm100.py@@ -448,6 +448,12 @@ self.load_warp_ids = (14, 15) self.empty_warp_ids = () + self.tmem_alloc_warp_ids = (+ self.mma_warp_id,+ *self.softmax0_warp_ids,+ *self.softmax1_warp_ids,+ *self.correction_warp_ids,+ ) if self.use_correction_warps_for_epi: self.empty_warp_ids = self.empty_warp_ids + self.epilogue_warp_ids self.epilogue_warp_ids = self.correction_warp_ids@@ -1732,15 +1738,7 @@ tmem_alloc_barrier = pipeline.NamedBarrier( barrier_id=int(NamedBarrierFwdSm100.TmemPtr),- num_threads=cute.arch.WARP_SIZE- * len(- (- self.mma_warp_id,- *self.softmax0_warp_ids,- *self.softmax1_warp_ids,- *self.correction_warp_ids,- )- ),+ num_threads=cute.arch.WARP_SIZE * len(self.tmem_alloc_warp_ids), ) # Tensor memory dealloc barrier init tmem = cutlass.utils.TmemAllocator(@@ -2207,11 +2205,11 @@ # /////////////////////////////////////////////////////////////////////////////// # MMA # ///////////////////////////////////////////////////////////////////////////////+ tmem.allocate(cute.arch.get_max_tmem_alloc_cols("sm_100"))+ if warp_idx in self.tmem_alloc_warp_ids:+ tmem.wait_for_alloc() if warp_idx == self.mma_warp_id: cute.arch.setmaxregister_decrease(self.num_regs_other)- # Alloc tensor memory buffer- tmem.allocate(cute.arch.get_max_tmem_alloc_cols("sm_100"))- tmem.wait_for_alloc() tmem_ptr = tmem.retrieve_ptr(self.qk_acc_dtype) self.mma( tiled_mma_qk,@@ -2278,8 +2276,6 @@ ) or (const_expr(self.q_stage == 1) and warp_idx <= self.softmax0_warp_ids[-1]): # increase register after decreasing cute.arch.setmaxregister_increase(self.num_regs_softmax)- # sync with mma warp before retrieving tmem ptr- tmem.wait_for_alloc() tmem_ptr = tmem.retrieve_ptr(self.qk_acc_dtype) softmax_loop = partial( self.softmax_loop,@@ -2335,8 +2331,6 @@ # /////////////////////////////////////////////////////////////////////////////// if warp_idx >= self.correction_warp_ids[0] and warp_idx < self.mma_warp_id: cute.arch.setmaxregister_decrease(self.num_regs_correction)- # sync with mma warp before retrieving tmem ptr- tmem.wait_for_alloc() tmem_ptr = tmem.retrieve_ptr(self.qk_acc_dtype) self.correction_loop( thr_mma_qk,@@ -4740,6 +4734,7 @@ else: row_max = None pipeline_sm_stats.consumer_release_w_index(stage)+ sink_rescale = Float32(1.0) if const_expr(learnable_sink is not None): LOG2_E = math.log2(math.e) sink_val = learnable_sink_val[stage]@@ -4749,18 +4744,22 @@ row_max = sink_val * (LOG2_E / softmax_scale_log2_eff) row_sum = max_offset_scale else:- row_sum += cute.math.exp2(- sink_val * LOG2_E- - row_max * softmax_scale_log2_eff- + max_offset,+ old_max_log2 = row_max * softmax_scale_log2_eff+ new_max_log2 = max(old_max_log2, sink_val * LOG2_E)+ sink_rescale = cute.math.exp2(+ old_max_log2 - new_max_log2, fastmath=True+ )+ row_sum = row_sum * sink_rescale + cute.math.exp2(+ sink_val * LOG2_E - new_max_log2 + max_offset, fastmath=True, )+ row_max = new_max_log2 / softmax_scale_log2_eff acc_O_mn_row_is_zero_or_nan = row_sum == 0.0 or row_sum != row_sum stats[stage] = (row_sum, row_max, acc_O_mn_row_is_zero_or_nan) scale = cute.arch.rcp_approx( row_sum if not acc_O_mn_row_is_zero_or_nan else 1.0 )- scale = scale * v_descale+ scale = scale * sink_rescale * v_descale # Wait for the last O to be ready from the MMA warp pipeline_o_acc.consumer_wait_w_index_phase( stage, o_corr_consumer_phase123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869#!/usr/bin/env bash# Install Flint support into an lmsysorg/sglang:v0.5.16-cu130 environment.# Used by the Dockerfile; can also be run (and re-run, e.g. to upgrade) inside an existing# container of that image, as root or not.## bash install.sh <dir containing fa4-learned-sink-fix.patch and one flint_sglang-*.whl>## Needs network access to pypi.org/files.pythonhosted.org, flashinfer.ai and github.com# (FlashInfer release assets). For air-gapped hosts, pre-download the wheels and run with# PIP_NO_INDEX=1 PIP_FIND_LINKS=<wheel dir>.set -euo pipefail
SRC_DIR="${1:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"# The image installs SGLang into the system Python; allow pip to update it there (PEP 668).export PIP_BREAK_SYSTEM_PACKAGES=1 PIP_ROOT_USER_ACTION=ignore PIP_NO_CACHE_DIR=1
# flashinfer 0.6.16.post1: the base image's 0.6.14 can hang trtllm MoE kernels on Blackwell.# The python, cubin and jit-cache wheels must move together.pip install --force-reinstall --no-deps \ --extra-index-url "https://flashinfer.ai/whl" \ --extra-index-url "https://flashinfer.ai/whl/cu130" \ "flashinfer-python==0.6.16.post1" \ "flashinfer-cubin==0.6.16.post1" \ "flashinfer-jit-cache==0.6.16.post1"
# CuTe-DSL runtime used to JIT-compile the FA4 attention kernels (4.6.0/4.6.1 hang on sm_103).pip install --force-reinstall --no-deps \ "nvidia-cutlass-dsl==4.6.2" \ "nvidia-cutlass-dsl-libs-base==4.6.2" \ "nvidia-cutlass-dsl-libs-core==4.6.2" \ "nvidia-cutlass-dsl-libs-cu12==4.6.2" \ "nvidia-cutlass-dsl-libs-cu13==4.6.2" \ "quack-kernels==0.6.4" \ "apache-tvm-ffi==0.1.12"
python3 - <<'EOF'from importlib.metadata import version as vexpected = { "flashinfer-python": "0.6.16.post1", "flashinfer-cubin": "0.6.16.post1", "flashinfer-jit-cache": "0.6.16.post1", "nvidia-cutlass-dsl": "4.6.2", "nvidia-cutlass-dsl-libs-base": "4.6.2", "nvidia-cutlass-dsl-libs-core": "4.6.2", "nvidia-cutlass-dsl-libs-cu12": "4.6.2", "nvidia-cutlass-dsl-libs-cu13": "4.6.2", "quack-kernels": "0.6.4", "apache-tvm-ffi": "0.1.12",}bad = {p: v(p) for p, want in expected.items() if not v(p).startswith(want)}assert not bad, f"unexpected package versions: {bad}"EOF
# FA4 learned-sink normalization and TMEM-allocation barrier fix for SGLang's vendored# FlashAttention-4 SM100 forward kernel. Required for --attention-backend fa4.SGL_DIR="$(python3 -c "import pathlib, sglang; print(pathlib.Path(sglang.__file__).parent)")"KERNEL="$SGL_DIR/jit_kernel/flash_attn/cute/flash_fwd_sm100.py"PATCHED_SHA=6ead08491135efdf2bf40d649a0f5ad732542287c530240ea1726a5c64f8ade3if echo "$PATCHED_SHA $KERNEL" | sha256sum -c --status -; then echo "FA4 learned-sink fix already applied."else echo "9b27db3b1d1b64bcd6e15bd47648bb3f22fe5614f79794f850c3808612efd949 $KERNEL" | sha256sum -c - patch -p3 -d "$SGL_DIR" < "$SRC_DIR/fa4-learned-sink-fix.patch" echo "$PATCHED_SHA $KERNEL" | sha256sum -c -fi
shopt -s nullglobwheels=("$SRC_DIR"/flint_sglang-*.whl)if [[ ${#wheels[@]} -ne 1 ]]; then echo "expected exactly one flint_sglang-*.whl in $SRC_DIR, found ${#wheels[@]}" >&2 exit 1fipip install --force-reinstall --no-deps "${wheels[0]}"python3 -c "from importlib.metadata import entry_points; assert any(e.name == 'flint' for e in entry_points(group='sglang.srt.plugins'))"echo "Flint support installed ($(basename "${wheels[0]}"))."123456789101112131415161718192021222324252627282930313233343536373839#!/usr/bin/env bash# One Flint replica on one Blackwell GPU. Validated on B300 (x86_64); B200 and GB200/GB300# (arm64 image) use the same flags but are not yet validated.## MODEL=/path/to/flint-v1.1 CUDA_VISIBLE_DEVICES=0 PORT=30000 bash serve_b300.sh## Extra arguments are passed through to sglang.launch_server.set -euo pipefail
MODEL="${MODEL:-RecursiveSI/flint-v1.1}"PORT="${PORT:-30000}"revision_args=()if [[ -n "${REVISION:-}" ]]; then revision_args=(--revision "$REVISION")fi
export SGLANG_EXTERNAL_MODEL_PACKAGE="${SGLANG_EXTERNAL_MODEL_PACKAGE:-flint_sglang}"export FLASHINFER_USE_CUDA_NORM="${FLASHINFER_USE_CUDA_NORM:-1}"# One Triton cache per replica: replicas compiling the same kernels into one cache directory can race.export TRITON_CACHE_DIR="${FLINT_TRITON_CACHE_BASE:-${HOME:-/tmp}/.triton/cache}/flint-$(hostname)-${PORT}"
exec python3 -m sglang.launch_server \ --model-path "$MODEL" "${revision_args[@]}" \ --served-model-name flint \ --host 0.0.0.0 --port "$PORT" \ --tp-size 1 \ --attention-backend fa4 \ --moe-runner-backend flashinfer_trtllm_routed \ --enable-fp32-lm-head \ --context-length 262144 \ --chunked-prefill-size 4096 \ --swa-full-tokens-ratio 0.05 \ --mem-fraction-static 0.8 \ --disable-piecewise-cuda-graph \ --disable-flashinfer-autotune \ --tool-call-parser flint \ --reasoning-parser flint \ --grammar-backend flint \ "$@"1234567891011121314151617181920212223242526272829303132333435363738#!/usr/bin/env bash# One Flint replica on one Hopper H200 GPU (141 GB). FA4 and the trtllm MoE kernels are# Blackwell-only, so this uses FA3 attention and Triton MoE. 80 GB H100s cannot hold the BF16# weights on one GPU.## MODEL=/path/to/flint-v1.1 CUDA_VISIBLE_DEVICES=0 PORT=30000 bash serve_h200.sh## Extra arguments are passed through to sglang.launch_server.set -euo pipefail
MODEL="${MODEL:-RecursiveSI/flint-v1.1}"PORT="${PORT:-30000}"revision_args=()if [[ -n "${REVISION:-}" ]]; then revision_args=(--revision "$REVISION")fi
export SGLANG_EXTERNAL_MODEL_PACKAGE="${SGLANG_EXTERNAL_MODEL_PACKAGE:-flint_sglang}"export FLASHINFER_USE_CUDA_NORM="${FLASHINFER_USE_CUDA_NORM:-1}"# One Triton cache per replica: replicas compiling the same kernels into one cache directory can race.export TRITON_CACHE_DIR="${FLINT_TRITON_CACHE_BASE:-${HOME:-/tmp}/.triton/cache}/flint-$(hostname)-${PORT}"
exec python3 -m sglang.launch_server \ --model-path "$MODEL" "${revision_args[@]}" \ --served-model-name flint \ --host 0.0.0.0 --port "$PORT" \ --tp-size 1 \ --attention-backend fa3 \ --moe-runner-backend triton \ --enable-fp32-lm-head \ --context-length 262144 \ --chunked-prefill-size 4096 \ --swa-full-tokens-ratio 0.4 \ --mem-fraction-static 0.9 \ --tool-call-parser flint \ --reasoning-parser flint \ --grammar-backend flint \ "$@"12345678910111213141516171819202122232425#!/usr/bin/env bash# Eight Flint replicas on one 8-GPU node, one GPU each, on ports BASE_PORT..BASE_PORT+7.# If one replica exits, all are stopped. Put a router in front of all replicas across nodes (on a# port outside those ranges), e.g. for 2 nodes:## python3 -m sglang_router.launch_router --host 0.0.0.0 --port 8000 --policy cache_aware \# --worker-urls http://node0:30000 ... http://node0:30007 http://node1:30000 ... http://node1:30007## MODEL=/path/to/flint-v1.1 BASE_PORT=30000 bash serve_node_8x.sh # Blackwell# MODEL=/path/to/flint-v1.1 SERVE_SCRIPT=serve_h200.sh bash serve_node_8x.sh # H200## Extra arguments are passed through to every replica's sglang.launch_server.set -euo pipefail
BASE_PORT="${BASE_PORT:-30000}"SERVE_SCRIPT="${SERVE_SCRIPT:-serve_b300.sh}"here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
pids=()for gpu in 0 1 2 3 4 5 6 7; do CUDA_VISIBLE_DEVICES="$gpu" PORT="$((BASE_PORT + gpu))" bash "$here/$SERVE_SCRIPT" "$@" & pids+=("$!")donetrap 'kill "${pids[@]}" 2>/dev/null; wait' EXIT INT TERMwait -n "${pids[@]}"123version https://git-lfs.github.com/spec/v1oid sha256:a263cce0b7e2b03f7ee07ce809783ef4b47f160c3f268a4ea1524f638da45b68size 1087912812345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295{ "add_bos_token": false, "add_eos_token": false, "added_tokens_decoder": { "150000": { "content": "<|begin_of_text|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150001": { "content": "<|end_of_text|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150002": { "content": "<|system|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150003": { "content": "<|user|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150004": { "content": "<|assistant|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150005": { "content": "<|observation|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150006": { "content": "<think>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150007": { "content": "</think>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150008": { "content": "<tools>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150009": { "content": "</tools>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150010": { "content": "<tool_call>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150011": { "content": "</tool_call>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150012": { "content": "<arg_key>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150013": { "content": "</arg_key>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150014": { "content": "<arg_value>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150015": { "content": "</arg_value>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150016": { "content": "<tool_response>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150017": { "content": "</tool_response>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": false }, "150018": { "content": "<|developer|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150019": { "content": "<|reserved_150019|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150020": { "content": "<|reserved_150020|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150021": { "content": "<|reserved_150021|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150022": { "content": "<|reserved_150022|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150023": { "content": "<|reserved_150023|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150024": { "content": "<|reserved_150024|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150025": { "content": "<|reserved_150025|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150026": { "content": "<|reserved_150026|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150027": { "content": "<|reserved_150027|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150028": { "content": "<|reserved_150028|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150029": { "content": "<|reserved_150029|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150030": { "content": "<|reserved_150030|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150031": { "content": "<|reserved_150031|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150032": { "content": "<|reserved_150032|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150033": { "content": "<|reserved_150033|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150034": { "content": "<|reserved_150034|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150035": { "content": "<|reserved_150035|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150036": { "content": "<|reserved_150036|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150037": { "content": "<|reserved_150037|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150038": { "content": "<|reserved_150038|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150039": { "content": "<|reserved_150039|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150040": { "content": "<|reserved_150040|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150041": { "content": "<|reserved_150041|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150042": { "content": "<|reserved_150042|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150043": { "content": "<|reserved_150043|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150044": { "content": "<|reserved_150044|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150045": { "content": "<|reserved_150045|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150046": { "content": "<|reserved_150046|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150047": { "content": "<|reserved_150047|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150048": { "content": "<|reserved_150048|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150049": { "content": "<|reserved_150049|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150050": { "content": "<|reserved_150050|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150051": { "content": "<|reserved_150051|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150052": { "content": "<|reserved_150052|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150053": { "content": "<|reserved_150053|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150054": { "content": "<|reserved_150054|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150055": { "content": "<|reserved_150055|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150056": { "content": "<|reserved_150056|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150057": { "content": "<|reserved_150057|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150058": { "content": "<|reserved_150058|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150059": { "content": "<|reserved_150059|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150060": { "content": "<|reserved_150060|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150061": { "content": "<|reserved_150061|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150062": { "content": "<|reserved_150062|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150063": { "content": "<|reserved_150063|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150064": { "content": "<|reserved_150064|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150065": { "content": "<|reserved_150065|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150066": { "content": "<|reserved_150066|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150067": { "content": "<|reserved_150067|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150068": { "content": "<|reserved_150068|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150069": { "content": "<|reserved_150069|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150070": { "content": "<|reserved_150070|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150071": { "content": "<|reserved_150071|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150072": { "content": "<|reserved_150072|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150073": { "content": "<|reserved_150073|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150074": { "content": "<|reserved_150074|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150075": { "content": "<|reserved_150075|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150076": { "content": "<|reserved_150076|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150077": { "content": "<|reserved_150077|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150078": { "content": "<|reserved_150078|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150079": { "content": "<|reserved_150079|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150080": { "content": "<|reserved_150080|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150081": { "content": "<|reserved_150081|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150082": { "content": "<|reserved_150082|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150083": { "content": "<|reserved_150083|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150084": { "content": "<|reserved_150084|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150085": { "content": "<|reserved_150085|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150086": { "content": "<|reserved_150086|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150087": { "content": "<|reserved_150087|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150088": { "content": "<|reserved_150088|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150089": { "content": "<|reserved_150089|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150090": { "content": "<|reserved_150090|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150091": { "content": "<|reserved_150091|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150092": { "content": "<|reserved_150092|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150093": { "content": "<|reserved_150093|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150094": { "content": "<|reserved_150094|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150095": { "content": "<|reserved_150095|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150096": { "content": "<|reserved_150096|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150097": { "content": "<|reserved_150097|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150098": { "content": "<|reserved_150098|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150099": { "content": "<|reserved_150099|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150100": { "content": "<|reserved_150100|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150101": { "content": "<|reserved_150101|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150102": { "content": "<|reserved_150102|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150103": { "content": "<|reserved_150103|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150104": { "content": "<|reserved_150104|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150105": { "content": "<|reserved_150105|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150106": { "content": "<|reserved_150106|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150107": { "content": "<|reserved_150107|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150108": { "content": "<|reserved_150108|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150109": { "content": "<|reserved_150109|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150110": { "content": "<|reserved_150110|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150111": { "content": "<|reserved_150111|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150112": { "content": "<|reserved_150112|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150113": { "content": "<|reserved_150113|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150114": { "content": "<|reserved_150114|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150115": { "content": "<|reserved_150115|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150116": { "content": "<|reserved_150116|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150117": { "content": "<|reserved_150117|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150118": { "content": "<|reserved_150118|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150119": { "content": "<|reserved_150119|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150120": { "content": "<|reserved_150120|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150121": { "content": "<|reserved_150121|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150122": { "content": "<|reserved_150122|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150123": { "content": "<|reserved_150123|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150124": { "content": "<|reserved_150124|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150125": { "content": "<|reserved_150125|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150126": { "content": "<|reserved_150126|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150127": { "content": "<|reserved_150127|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150128": { "content": "<|reserved_150128|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150129": { "content": "<|reserved_150129|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150130": { "content": "<|reserved_150130|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150131": { "content": "<|reserved_150131|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150132": { "content": "<|reserved_150132|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150133": { "content": "<|reserved_150133|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150134": { "content": "<|reserved_150134|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150135": { "content": "<|reserved_150135|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150136": { "content": "<|reserved_150136|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150137": { "content": "<|reserved_150137|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150138": { "content": "<|reserved_150138|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150139": { "content": "<|reserved_150139|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150140": { "content": "<|reserved_150140|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150141": { "content": "<|reserved_150141|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150142": { "content": "<|reserved_150142|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true }, "150143": { "content": "<|reserved_150143|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": false, "special": true } }, "additional_special_tokens": [ "<|system|>", "<|user|>", "<|assistant|>", "<|observation|>", "<|developer|>", "<|reserved_150019|>", "<|reserved_150020|>", "<|reserved_150021|>", "<|reserved_150022|>", "<|reserved_150023|>", "<|reserved_150024|>", "<|reserved_150025|>", "<|reserved_150026|>", "<|reserved_150027|>", "<|reserved_150028|>", "<|reserved_150029|>", "<|reserved_150030|>", "<|reserved_150031|>", "<|reserved_150032|>", "<|reserved_150033|>", "<|reserved_150034|>", "<|reserved_150035|>", "<|reserved_150036|>", "<|reserved_150037|>", "<|reserved_150038|>", "<|reserved_150039|>", "<|reserved_150040|>", "<|reserved_150041|>", "<|reserved_150042|>", "<|reserved_150043|>", "<|reserved_150044|>", "<|reserved_150045|>", "<|reserved_150046|>", "<|reserved_150047|>", "<|reserved_150048|>", "<|reserved_150049|>", "<|reserved_150050|>", "<|reserved_150051|>", "<|reserved_150052|>", "<|reserved_150053|>", "<|reserved_150054|>", "<|reserved_150055|>", "<|reserved_150056|>", "<|reserved_150057|>", "<|reserved_150058|>", "<|reserved_150059|>", "<|reserved_150060|>", "<|reserved_150061|>", "<|reserved_150062|>", "<|reserved_150063|>", "<|reserved_150064|>", "<|reserved_150065|>", "<|reserved_150066|>", "<|reserved_150067|>", "<|reserved_150068|>", "<|reserved_150069|>", "<|reserved_150070|>", "<|reserved_150071|>", "<|reserved_150072|>", "<|reserved_150073|>", "<|reserved_150074|>", "<|reserved_150075|>", "<|reserved_150076|>", "<|reserved_150077|>", "<|reserved_150078|>", "<|reserved_150079|>", "<|reserved_150080|>", "<|reserved_150081|>", "<|reserved_150082|>", "<|reserved_150083|>", "<|reserved_150084|>", "<|reserved_150085|>", "<|reserved_150086|>", "<|reserved_150087|>", "<|reserved_150088|>", "<|reserved_150089|>", "<|reserved_150090|>", "<|reserved_150091|>", "<|reserved_150092|>", "<|reserved_150093|>", "<|reserved_150094|>", "<|reserved_150095|>", "<|reserved_150096|>", "<|reserved_150097|>", "<|reserved_150098|>", "<|reserved_150099|>", "<|reserved_150100|>", "<|reserved_150101|>", "<|reserved_150102|>", "<|reserved_150103|>", "<|reserved_150104|>", "<|reserved_150105|>", "<|reserved_150106|>", "<|reserved_150107|>", "<|reserved_150108|>", "<|reserved_150109|>", "<|reserved_150110|>", "<|reserved_150111|>", "<|reserved_150112|>", "<|reserved_150113|>", "<|reserved_150114|>", "<|reserved_150115|>", "<|reserved_150116|>", "<|reserved_150117|>", "<|reserved_150118|>", "<|reserved_150119|>", "<|reserved_150120|>", "<|reserved_150121|>", "<|reserved_150122|>", "<|reserved_150123|>", "<|reserved_150124|>", "<|reserved_150125|>", "<|reserved_150126|>", "<|reserved_150127|>", "<|reserved_150128|>", "<|reserved_150129|>", "<|reserved_150130|>", "<|reserved_150131|>", "<|reserved_150132|>", "<|reserved_150133|>", "<|reserved_150134|>", "<|reserved_150135|>", "<|reserved_150136|>", "<|reserved_150137|>", "<|reserved_150138|>", "<|reserved_150139|>", "<|reserved_150140|>", "<|reserved_150141|>", "<|reserved_150142|>", "<|reserved_150143|>" ], "bos_token": "<|begin_of_text|>", "clean_up_tokenization_spaces": false, "eos_token": "<|end_of_text|>", "model_max_length": 262144, "tokenizer_class": "PreTrainedTokenizerFast"}.gitattributesAdded+40
LICENSEAdded+201
README.mdAdded+117
assets/flint-logo.pngAdded

Large File Pointer Details
- SHA256: b95290bec100def989fd410999f8129d43068900705a0609a78cdbafa930ad61
- Pointer size: 131 Bytes
- Size of remote file: 410 kB
assets/flint_1.1_benchmarks.pngAdded

Large File Pointer Details
- SHA256: 1ee883453928dccc70c6aaed0765a572ded05345a88de5d189dffeb9be2cf92a
- Pointer size: 131 Bytes
- Size of remote file: 383 kB
assets/flint_1.1_quantization.pngAdded

Large File Pointer Details
- SHA256: 10611d8fd8c9fa52e830cc4809f54a8b23175fc2d4fd9b1a5f1809a1af251ad4
- Pointer size: 131 Bytes
- Size of remote file: 441 kB
assets/flint_1.1_tool_calling.pngAdded

Large File Pointer Details
- SHA256: f7fa564f99e410d8abddc7c8ae7cd6e850e5dbac2b047632914defff977047e4
- Pointer size: 131 Bytes
- Size of remote file: 551 kB
chat_template.jinjaAdded+61
config.jsonAdded+115
generation_config.jsonAdded+14
model-00001-of-00015.safetensorsAdded+3
model-00002-of-00015.safetensorsAdded+3
model-00003-of-00015.safetensorsAdded+3
model-00004-of-00015.safetensorsAdded+3
model-00005-of-00015.safetensorsAdded+3
model-00006-of-00015.safetensorsAdded+3
model-00007-of-00015.safetensorsAdded+3
model-00008-of-00015.safetensorsAdded+3
model-00009-of-00015.safetensorsAdded+3
model-00010-of-00015.safetensorsAdded+3
model-00011-of-00015.safetensorsAdded+3
model-00012-of-00015.safetensorsAdded+3
model-00013-of-00015.safetensorsAdded+3
model-00014-of-00015.safetensorsAdded+3
model-00015-of-00015.safetensorsAdded+3
model.safetensors.index.jsonAdded
sglang/DockerfileAdded+14
sglang/NOTICEAdded+41
sglang/README.mdAdded+202
sglang/example_client.pyAdded+71
sglang/example_tools.pyAdded+178
sglang/fa4-learned-sink-fix.patchAdded+101
sglang/flint_sglang-0.1.4-py3-none-any.whlAdded
sglang/install.shAdded+69
sglang/serve_b300.shAdded+39
sglang/serve_h200.shAdded+38
sglang/serve_node_8x.shAdded+25
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+1295