Run this model with HF Jobs
Run thinkingmachines/TML-d24-varloop-research on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/thinkingmachines/TML-d24-varloop-research. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/thinkingmachines/TML-d24-varloop-research on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/thinkingmachines/TML-d24-varloop-research. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/thinkingmachines/TML-d24-varloop-research. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use thinkingmachines/TML-d24-varloop-research with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thinkingmachines/TML-d24-varloop-research with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="thinkingmachines/TML-d24-varloop-research") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("thinkingmachines/TML-d24-varloop-research") model = AutoModelForMultimodalLM.from_pretrained("thinkingmachines/TML-d24-varloop-research", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thinkingmachines/TML-d24-varloop-research with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thinkingmachines/TML-d24-varloop-research" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thinkingmachines/TML-d24-varloop-research", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/thinkingmachines/TML-d24-varloop-research
- SGLang
How to use thinkingmachines/TML-d24-varloop-research 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 "thinkingmachines/TML-d24-varloop-research" \ --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": "thinkingmachines/TML-d24-varloop-research", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "thinkingmachines/TML-d24-varloop-research" \ --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": "thinkingmachines/TML-d24-varloop-research", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use thinkingmachines/TML-d24-varloop-research with Docker Model Runner:
docker model run hf.co/thinkingmachines/TML-d24-varloop-research
Render past tool calls with the empty header this model writes
Browse filesTML-d24-varloop-research writes its tool calls with an empty message header:
```
<|message_model|><|content_invoke_tool_json|>{"name":"bash","args":{...}}<|end_message|>
```
The chat template, and SGLang's built-in Inkling 2 renderer, render every past tool call with the tool's name in that header (`<|message_model|>bash<|content_invoke_tool_json|>`), as Inkling-2-Mini writes it. Once earlier tool calls are in the conversation, the model often copies the name into its next header and then writes the call as plain text without `<|content_invoke_tool_json|>`, so the response comes back with no tool call. Turns with no tool call were about 11% in a multi-turn coding agent.
This PR:
- `config.json`: adds `"tool_call_author_name_mode": "independent"` to `text_config`, so serving stacks know which header the checkpoint writes.
- `chat_template.jinja`: the tool-call header carries the assistant message's own name (empty when it has none) instead of the tool's name. Nothing else in the template changes.
SGLang support: https://github.com/zcnrex/sglang/pull/5 adds `--inkling2-tool-call-author-name-mode` and reads its default from this `config.json` field. It has landed into the upstream Inkling 2 PR, https://github.com/sgl-project/sglang/pull/51926. With the latest version of that PR, the model works with no extra flags. `transformers` / `apply_chat_template` users get the fix from the updated template.
With both changes, turns with no tool call went to 0 in the same agent setup, through SGLang's renderer and through the chat template.
Files changed (2)
- chat_template.jinja+2-4
- config.json+118-117
99 unmodified lines1001011021031041051061071081 unmodified line11011111211311411511699 unmodified lines{%- if fn.name is not defined or fn.name is not string -%}{{- raise_exception("tool call function name must be a string") -}}{%- endif -%}{%- if message.name is defined and message.name and message.name != fn.name -%}{{- raise_exception("assistant name " ~ message.name ~ " does not match its tool call " ~ fn.name) -}}{%- endif -%}{%- set args = fn.arguments if fn.arguments is defined and fn.arguments else {} -%}{%- if args is string -%}{{- raise_exception("tool call arguments must be a parsed object, not a JSON string; canonicalize upstream") -}}1 unmodified line{%- if args is not mapping -%}{{- raise_exception("tool call arguments must be an object") -}}{%- endif -%}{{- "<|message_model|>" ~ fn.name ~ "<|content_invoke_tool_json|>" -}}{{- '{"name":' ~ (fn.name | tojson(sort_keys=true, separators=(",", ":"))) ~ ',"args":' -}}{{- "{" -}}{%- for key, value in args | dictsort(case_sensitive=true) -%}99 unmodified lines1001011021031041051 unmodified line10710810911011111211311499 unmodified lines{%- if fn.name is not defined or fn.name is not string -%}{{- raise_exception("tool call function name must be a string") -}}{%- endif -%}{%- set args = fn.arguments if fn.arguments is defined and fn.arguments else {} -%}{%- if args is string -%}{{- raise_exception("tool call arguments must be a parsed object, not a JSON string; canonicalize upstream") -}}1 unmodified line{%- if args is not mapping -%}{{- raise_exception("tool call arguments must be an object") -}}{%- endif -%}{#- The header carries the assistant's own name, or none: never the tool's. -#}{{- rtok ~ "<|content_invoke_tool_json|>" -}}{{- '{"name":' ~ (fn.name | tojson(sort_keys=true, separators=(",", ":"))) ~ ',"args":' -}}{{- "{" -}}{%- for key, value in args | dictsort(case_sensitive=true) -%}
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121{"architectures": ["Inkling2LoopForConditionalGeneration"],"model_type": "inkling2_loop","eos_token_id": 200006,"text_config": {"model_type": "inkling2_loop_text","model_max_length": 1048576,"torch_dtype": "bfloat16","hidden_size": 2304,"num_hidden_layers": 24,"vocab_size": 201024,"num_attention_heads": 24,"num_key_value_heads": 8,"head_dim": 128,"d_rel": 16,"rel_extent": 1024,"q_bias": false,"o_bias": false,"log_scaling_n_floor": 8192,"log_scaling_alpha": 0.1,"rms_norm_eps": 1e-06,"use_value_norm_no_gamma": true,"qk_l2_clip_threshold": 22.627416997969522,"rel_l2_clip_threshold": 8.0,"local_layer_ids": [0,1,2,3,4,6,7,8,9,10,12,13,14,15,16,18,19,20,21,22],"sconv_kernel_size": 4,"unpadded_vocab_size": 200058,"final_logit_softcapping": 30.0,"swa_head_dim": 128,"swa_num_attention_heads": 24,"swa_num_key_value_heads": 8,"sliding_window_size": 1024,"n_layers_per_attn_res_block": 6,"attn_res_normalize_values": true,"n_routed_experts": 128,"num_experts_per_tok": 8,"n_shared_experts": 0,"intermediate_size": 1152,"mlp_gate_softcap": 4.0,"mlp_up_softcap": 25.0,"route_scale": 8.0,"use_gate_bias": true,"loop_config": {"core_start": 6,"core_end": 18,"num_passes": 3,"gate_rank": 64,"is_varloop": true}},"vision_config": {"model_type": "inkling2_vision","text_hidden_size": 2304,"temporal_patch_size": 2,"native_patch_size": 20,"adapter_merge_size": 2,"projection_hidden_dim": 4096,"projector_bias": false,"hidden_size": 1024,"num_hidden_layers": 23,"num_attention_heads": 16,"mlp_ratio": 4.0,"posemb_grid_size": 32,"layer_norm_eps": 1e-05},"mtp_config": {"hidden_size": 2304,"num_hidden_layers": 3,"num_attention_heads": 24,"num_key_value_heads": 8,"head_dim": 128,"intermediate_size": 9216,"max_position_embeddings": 1048576,"torch_dtype": "bfloat16","q_bias": false,"o_bias": false,"rms_norm_eps": 1e-06,"rope_theta": 1000000.0,"local_layer_ids": [0,2],"sliding_window_size": 1024,"block_size": 8,"markov_rank": 256,"markov_head_type": "rnn_hidden","target_layer_ids": [5,23,41,48]},"quantization_config": {"quant_method": "modelopt","quant_algo": "NVFP4"}}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122{"architectures": ["Inkling2LoopForConditionalGeneration"],"model_type": "inkling2_loop","eos_token_id": 200006,"text_config": {"model_type": "inkling2_loop_text","model_max_length": 1048576,"torch_dtype": "bfloat16","hidden_size": 2304,"num_hidden_layers": 24,"vocab_size": 201024,"num_attention_heads": 24,"num_key_value_heads": 8,"head_dim": 128,"d_rel": 16,"rel_extent": 1024,"q_bias": false,"o_bias": false,"log_scaling_n_floor": 8192,"log_scaling_alpha": 0.1,"rms_norm_eps": 1e-06,"use_value_norm_no_gamma": true,"qk_l2_clip_threshold": 22.627416997969522,"rel_l2_clip_threshold": 8.0,"local_layer_ids": [0,1,2,3,4,6,7,8,9,10,12,13,14,15,16,18,19,20,21,22],"sconv_kernel_size": 4,"unpadded_vocab_size": 200058,"final_logit_softcapping": 30.0,"swa_head_dim": 128,"swa_num_attention_heads": 24,"swa_num_key_value_heads": 8,"sliding_window_size": 1024,"n_layers_per_attn_res_block": 6,"attn_res_normalize_values": true,"n_routed_experts": 128,"num_experts_per_tok": 8,"n_shared_experts": 0,"intermediate_size": 1152,"mlp_gate_softcap": 4.0,"mlp_up_softcap": 25.0,"route_scale": 8.0,"use_gate_bias": true,"loop_config": {"core_start": 6,"core_end": 18,"num_passes": 3,"gate_rank": 64,"is_varloop": true},"tool_call_author_name_mode": "independent"},"vision_config": {"model_type": "inkling2_vision","text_hidden_size": 2304,"temporal_patch_size": 2,"native_patch_size": 20,"adapter_merge_size": 2,"projection_hidden_dim": 4096,"projector_bias": false,"hidden_size": 1024,"num_hidden_layers": 23,"num_attention_heads": 16,"mlp_ratio": 4.0,"posemb_grid_size": 32,"layer_norm_eps": 1e-05},"mtp_config": {"hidden_size": 2304,"num_hidden_layers": 3,"num_attention_heads": 24,"num_key_value_heads": 8,"head_dim": 128,"intermediate_size": 9216,"max_position_embeddings": 1048576,"torch_dtype": "bfloat16","q_bias": false,"o_bias": false,"rms_norm_eps": 1e-06,"rope_theta": 1000000.0,"local_layer_ids": [0,2],"sliding_window_size": 1024,"block_size": 8,"markov_rank": 256,"markov_head_type": "rnn_hidden","target_layer_ids": [5,23,41,48]},"quantization_config": {"quant_method": "modelopt","quant_algo": "NVFP4"}}