Instructions to use RecursiveSI/flint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RecursiveSI/flint with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RecursiveSI/flint") 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") model = AutoModelForCausalLM.from_pretrained("RecursiveSI/flint", 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 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RecursiveSI/flint" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RecursiveSI/flint
- SGLang
How to use RecursiveSI/flint 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RecursiveSI/flint with Docker Model Runner:
docker model run hf.co/RecursiveSI/flint
Flint needs constrained tool-call decoding outside rec (notes for other runtimes)
Thanks for Flint. Sharing what we found while running it in coding agents outside rec, in case it helps others who serve it.
1. Without a tool-call grammar, Flint invents argument names
rec runs Flint with --grammar flint, which keeps tool calls inside each request's tool schemas. With that grammar turned off (--grammar none), flint-int4 called OpenCode's read tool with path instead of the schema's filePath on 2 of 3 seeds of the same request. The tool definitions were in the prompt, so the model saw the right name.
Runtimes without tool-call constraints see this a lot. In OpenCode with mlx-vlm 0.7.10 (a 3-bit community build of Flint), 41 of 85 tool calls failed. The agent recovered through shell commands, so the tasks still passed, but slowly.
2. Constrained decoding must allow every stop token
generation_config.json lists four EOS ids, and Flint ends a tool-call turn on <|observation|>. A grammar that allows only eos_token_id (<|end_of_text|>) can't stop after a complete tool call. In our first attempt, one reply ran to about 19.6K tokens.
What fixed it for us
A grammar for the glm47-style format that limits tool names and argument names to the request's schemas (required arguments included), plus all four stop tokens. In the same OpenCode test, failed tool calls went from 41 of 85 to 0 of 50, with no measurable decode slowdown. The change is open for mlx-vlm: https://github.com/Blaizzy/mlx-vlm/pull/2571
Suggestion
A short "Serving Flint" note on the model card would save other integrators this debugging:
- use constrained tool-call decoding, as
recdoes; - treat all
eos_token_idvalues ingeneration_config.jsonas stop tokens, especially<|observation|>.