Instructions to use fwerkor/CID-v1-0.4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fwerkor/CID-v1-0.4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fwerkor/CID-v1-0.4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("fwerkor/CID-v1-0.4B", trust_remote_code=True) model = AutoModelForMaskedLM.from_pretrained("fwerkor/CID-v1-0.4B", trust_remote_code=True, 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fwerkor/CID-v1-0.4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fwerkor/CID-v1-0.4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fwerkor/CID-v1-0.4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fwerkor/CID-v1-0.4B
- SGLang
How to use fwerkor/CID-v1-0.4B 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 "fwerkor/CID-v1-0.4B" \ --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": "fwerkor/CID-v1-0.4B", "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 "fwerkor/CID-v1-0.4B" \ --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": "fwerkor/CID-v1-0.4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fwerkor/CID-v1-0.4B with Docker Model Runner:
docker model run hf.co/fwerkor/CID-v1-0.4B
CID-v1-0.4B
CID-v1-0.4B is a small-scale reference checkpoint for Continuous Interaction Diffusion (CID), converted from a 4-rank FSDP Stage B epoch-1 checkpoint.
CID is a diffusion-native runtime/model architecture for continuous asynchronous tool-augmented reasoning. This 0.4B checkpoint is provided as a compact research and reproducibility artifact; larger CID models are used for the main end-to-end capability results.
Files
model.safetensors— Stage B-updatedLFM2.5-Encoder-350M-Diffusionbackbone in Hugging Face key layout.cid_adapter.safetensors— CID-specific modules, including TCT/display projections, external fusion, and CID output heads.semantic-embedding.pt— frozen semantic encoder snapshot required by CID neural contract v4.cid_config.json— CID geometry, source-training metadata, checkpoint selection, and SHA-256 hashes.config.json, tokenizer files, andmodeling_lfm2_bidirectional.py— backbone configuration and custom model code.
The release contains 398,775,265 parameters in total: 354,483,968 backbone parameters and 44,291,297 CID-specific parameters. The published weights preserve the FP32 parameter dtype of the selected checkpoint; no quantization was applied during conversion.
Usage
This is not a standalone autoregressive/chat checkpoint. CID inference requires the CID runtime and the CID sidecar state in this repository.
Code: https://github.com/fwerkor/continuous-interaction-diffusion
A minimal loader follows the same path used by the CID runtime: load the bidirectional LFM2 backbone from this repository, instantiate the CID adapter with cid_config.json, load cid_adapter.safetensors, and restore semantic-embedding.pt as the frozen semantic encoder snapshot.
Reproduction
For loading, runtime inference, validation, and benchmark reproduction, use code commit f90ddb273d74d08274e1c0684b57196a072c0a0f. It includes the benchmark fix that removes ground-truth Display-length leakage and the runtime fix for cache-hit quiescence. The weights were trained with code snapshot 6e1e327d8777c0d5d1bb622dc1f848f7a3356959, retained as training provenance. Training used 4× NVIDIA RTX A6000 48 GB GPUs with BF16 mixed-precision compute. The training corpus is fwerkor/CID-Dataset, file release/training-trajectories.jsonl, SHA-256:
07662203cc23f5ee628623090ad029740e51b3d6efb13466a6dcad23a2a3b143
Training data
The training corpus contains 192,729 semantic tasks, compiled into 422,230 runtime trajectories, 2,724,556 adjacent trajectory transitions, and 3,146,786 total training transitions when 422,230 causal bootstrap transitions are included. The maximum trajectory length is 44 steps and the maximum TCT capacity is 128 slots. The materialized JSONL is 9,121,828,899 bytes.
The semantic-mode mixture contains 43,981 no-tool tasks, 135,086 tool-required tasks, and 13,662 tools-available-but-unnecessary tasks. The corpus mixes natural/public QA and dialogue data with interaction, correction, computational, symbolic, long-horizon, multilingual, self-identity, and tool-restraint curricula. The dataset card documents the component mixture, upstream provenance, per-component weights, and licenses.
The per-epoch neural-contract validation split contains 512 held-out examples / 3,449 validation transitions. It includes compositional/OOD reasoning, held-out tool-required interactions, and independent-seed curated contract probes.
Dataset DOI: 10.57967/hf/10103.
Stage A — CID structure learning
Stage A starts from LiquidAI/LFM2.5-Encoder-350M-Diffusion with the backbone frozen and trains the CID-specific modules.
| Hyperparameter | Value |
|---|---|
| Epochs | 3 |
| Optimizer | AdamW |
| CID learning rate | 1e-4 (constant) |
| Weight decay | 0.01 |
| Max gradient norm | 1.0 |
| World size | 4 |
| Micro-batch size | 24 per rank |
| Gradient accumulation | 1 |
| Effective global batch | 96 |
| Diffusion timestep range | [0.05, 1.0] |
| Rollout horizon | 3 |
| Teacher-forcing epochs | 1 |
| Rollout ramp epochs | 2 |
| Rollout denoising steps | 8 |
| Display revision fraction | 1.0 |
| Display revision margin | 0.0 |
| Allocation threshold | 0.8 |
| Max allocations / step | 32 |
| Semantic pooling | order-aware-v2 |
| Seed | 0 |
| Final optimizer step | 93,754 |
The Stage A handoff used stage-a-epoch-0003.pt.
Stage B — full-model adaptation
Stage B initializes from the Stage A epoch-3 checkpoint, unfreezes the backbone, and jointly trains the CID modules and backbone with separate learning-rate scales.
| Hyperparameter | Value |
|---|---|
| Epochs | 1 |
| Optimizer | AdamW |
| Peak CID learning rate | 1e-5 |
| Peak backbone learning rate | 5e-6 |
| LR schedule | linear warmup + cosine decay |
| Warmup steps | 2,947 |
| LR decay horizon | 98,240 steps |
| Minimum LR ratio | 0.1 |
| Weight decay | 0.01 |
| Max gradient norm | 1.0 |
| World size | 4 |
| Micro-batch size | 1 per rank |
| Gradient accumulation | 8 |
| Effective global batch | 32 |
| Diffusion timestep range | [0.05, 1.0] |
| Rollout horizon | 3 |
| Teacher-forcing epochs | 0 |
| Rollout ramp epochs | 0 |
| Rollout denoising steps | 8 |
| Display revision fraction | 1.0 |
| Display revision margin | 0.0 |
| Allocation threshold | 0.8 |
| Max allocations / step | 32 |
| Semantic pooling | order-aware-v2 |
| Seed | 0 |
| Final optimizer step | 98,190 |
The checkpoint preserves the frozen semantic-embedding snapshot used during Stage B (order-aware-v2) and publishes it as semantic-embedding.pt.
Reproduction pointers
- Code: https://github.com/fwerkor/continuous-interaction-diffusion/tree/f90ddb273d74d08274e1c0684b57196a072c0a0f
- Training data: https://huggingface.co/datasets/fwerkor/CID-Dataset
- Paper: https://arxiv.org/abs/2608.10438
- Base checkpoint: https://huggingface.co/LiquidAI/LFM2.5-Encoder-350M-Diffusion
Training logs
Sanitized training and validation records are published under logs/. They include rank-0 optimization metrics for both stages, Stage A per-epoch validation/runtime probes, the Stage B epoch-1 validation summary, and concise console/progress logs.
Useful entry points:
logs/stage-a/train_metrics.rank-0000.jsonl— Stage A loss/component/LR/progress history.logs/stage-a/validation_metrics.jsonl— teacher-forced and free-rollout validation at each Stage A epoch.logs/stage-a/runtime_validation_metrics.jsonl— end-to-end runtime probe records.logs/stage-b/train_metrics.rank-0000.jsonl— Stage B optimization history.logs/stage-b/validation_metrics.jsonl— validation summary for Stage B epoch 1.logs/manifest.json— SHA-256 hashes for the sanitized public log files.
The public logs preserve numerical metrics, timestamps, optimizer steps, learning rates, losses, validation outputs, and Git commit identifiers. Local usernames, absolute local paths, and internal host names were redacted before publication. See logs/README.md for the sanitization scope.
Runtime calibration and observed tool behavior
Head-level free-rollout diagnostics at the default tool-need threshold show 92.9% tool-need precision (13 TP / 1 FP), 2.4% tool-need recall, and 97.2% source-selection accuracy. These head-level metrics describe individual supervised decision points and do not directly measure closed-loop tool completion.
A runtime threshold calibration was therefore run on 138 validation cases: 134 tool-required cases, 4 tool-restraint cases, and 171 expected observations in total. With need_threshold=0.4, the allocation-threshold sweep produced:
| Allocation threshold | Observation coverage | Tool-required tasks with ≥1 expected observation | Completed tool calls | Restraint cases with a tool call |
|---|---|---|---|---|
0.8 |
97 / 171 = 56.7% | 95 / 134 = 70.9% | 99 | 0 / 4 |
0.7 |
102 / 171 = 59.6% | 100 / 134 = 74.6% | 102 | 0 / 4 |
0.65 |
99 / 171 = 57.9% | 97 / 134 = 72.4% | 99 | 0 / 4 |
0.6 |
97 / 171 = 56.7% | 95 / 134 = 70.9% | 97 | 0 / 4 |
The best tested setting was need_threshold=0.4, allocation_threshold=0.7, reaching 59.6% observation coverage while preserving zero tool calls on the four restraint probes. The sweep used a 15-second per-case diagnostic wall-time cap; six tool-required cases exhausted that cap at the selected setting. Because these thresholds were selected on the validation set, this is a runtime calibration result, not a held-out benchmark score.
Checkpoint provenance
- Base model:
LiquidAI/LFM2.5-Encoder-350M-Diffusion - CID neural contract: v4
- Stage: Stage B
- Selected checkpoint: Stage B epoch 1
- Optimizer steps: 98,190
- Training transitions seen: 805,452
The source training checkpoint used 4-rank FSDP storage. The published package removes optimizer state and rank-local training state and converts the model into portable inference weights. A cold-load validation reproduced the checkpoint's inference behavior.
Intended use and limitations
This checkpoint is intended for CID research, reproduction, runtime development, and small-scale mechanism studies. It is not the main full-capability CID model or a general-purpose chat model. End-to-end behavior is evaluated through the CID runtime rather than a standard left-to-right generation API.
Paper and citation
This checkpoint accompanies the CID paper: Continuous Interaction Diffusion: A Diffusion-Native Runtime for Asynchronous Tool-Augmented Reasoning (arXiv:2608.10438, DOI).
If you use this model or the CID runtime, please cite:
@article{cao2026continuous,
title = {Continuous Interaction Diffusion: A Diffusion-Native Runtime for Asynchronous Tool-Augmented Reasoning},
author = {Cao, Yuhang},
journal = {arXiv preprint arXiv:2608.10438},
year = {2026},
doi = {10.48550/arXiv.2608.10438},
url = {https://arxiv.org/abs/2608.10438}
}
License
The backbone is derived from Liquid AI's LFM2.5-Encoder-350M-Diffusion and is distributed under the accompanying LFM 1.0 license terms in LICENSE.
- Downloads last month
- 213
Model tree for fwerkor/CID-v1-0.4B
Base model
LiquidAI/LFM2.5-350M-Base