Run this model with HF Jobs
Run HengtaoWu/X-Live-Dual 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/HengtaoWu/X-Live-Dual. Ask me which dataset to train on, then push the fine-tuned model to a new private 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/HengtaoWu/X-Live-Dual 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/HengtaoWu/X-Live-Dual. Ask me which benchmark to run, then save the scores and the per-example results to a new private 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/HengtaoWu/X-Live-Dual. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use HengtaoWu/X-Live-Dual with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HengtaoWu/X-Live-Dual with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HengtaoWu/X-Live-Dual") 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("HengtaoWu/X-Live-Dual") model = AutoModelForCausalLM.from_pretrained("HengtaoWu/X-Live-Dual", 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 HengtaoWu/X-Live-Dual with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HengtaoWu/X-Live-Dual" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HengtaoWu/X-Live-Dual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HengtaoWu/X-Live-Dual
- SGLang
How to use HengtaoWu/X-Live-Dual 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 "HengtaoWu/X-Live-Dual" \ --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": "HengtaoWu/X-Live-Dual", "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 "HengtaoWu/X-Live-Dual" \ --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": "HengtaoWu/X-Live-Dual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HengtaoWu/X-Live-Dual with Docker Model Runner:
docker model run hf.co/HengtaoWu/X-Live-Dual
X-Live Dual
X-Live Dual is a self-contained model for natural dialogue and asynchronous tool use. It includes the complete X-Live Base weights and all Dual components; no separate Base download is required.
Transformers Quickstart
Install the dependencies:
pip install torch transformers peft accelerate safetensors huggingface_hub
Download the self-contained model repository and run the included Transformers reference implementation:
huggingface-cli download HengtaoWu/X-Live-Dual --local-dir X-Live-Dual
cd X-Live-Dual
from inference_transformers import XLiveDualForGeneration
model = XLiveDualForGeneration.from_pretrained(
".",
device_map="auto",
)
result = model.generate(
"Could you find me a nonstop flight from Shanghai to Seattle next Friday evening?"
)
print("Dialogue:", result.dialogue)
print("Action:", result.action)
print("Tool call:", result.tool_call)
Example output:
Dialogue: Absolutely โ Iโll look for nonstop options leaving next Friday evening.
Action: DELEGATE
Tool call: {
"name": "delegate",
"arguments": {
"task": "Find nonstop flights from Shanghai to Seattle next Friday evening."
}
}
This reference path runs the complete Action Gate, Action Embedding, Dialogue branch, and Tool branch directly with Transformers. It is intended for simple local inference and correctness checks. For high-throughput serving, use the vLLM integration linked below.
Architecture
The Action Gate predicts one of five actions:
NO_TOOLDELEGATEUPDATEINSPECTCANCEL
Layers 1โ44 process the context once. The Action Gate selects a learned 2048-dimensional Action Embedding, which is injected at the branch boundary. Dialogue and Tool then continue through the final four Transformer layers with different LoRA adapters.
The two branches decode concurrently. They have independent upper-layer KV state, stopping conditions, and output lengths, so their tokens do not need to align. The Dialogue stream is returned to the user, while the Tool stream is parsed and dispatched to the backend. Gate decisions and Tool tokens never enter the visible conversation history.
High-throughput vLLM Inference
X-Live Dual requires a custom vLLM integration for shared prefill, branch-aware KV management, and concurrent Dialogue/Tool decoding. The vLLM patch, launch scripts, and usage are maintained in the X-Live repository.
With the X-Live vLLM integration installed, the minimal launch command is:
XLIVE_MODEL_DIR=/path/to/X-Live-Dual \
XLIVE_DUAL_CHECKPOINT=/path/to/X-Live-Dual \
XLIVE_TP_SIZE=4 \
bash scripts/start_xlive_dual_model.sh
This starts an OpenAI-compatible text endpoint at
http://127.0.0.1:8002/v1. The same self-contained model directory is used as
both the backbone and the Dual checkpoint.
The vLLM integration performs the following steps for each request:
- Prefill the shared Transformer layers once.
- Predict the Action and inject its Action Embedding.
- Fork branch-specific upper-layer KV state.
- Decode Dialogue and Tool branches concurrently.
- Stream Dialogue through the OpenAI response.
- Validate the Tool output against the selected Action and publish it through the Tool side channel.
Stock Transformers or stock vLLM can load the included X-Live Base weights, but they do not implement X-Live Dual branch execution.
Model Files
config.json X-Live Base configuration
model-00001-of-00013.safetensors complete merged Base weights
...
model-00013-of-00013.safetensors
action_gate/ five-action classifier
action_embedding.safetensors invisible action conditioning
dialogue/ Dialogue LoRA
tool/ Tool LoRA
tokenizer.json tokenizer and Tool tokens
chat_template.jinja prompt format
system_prompt.txt frontend system prompt
tools.json Tool schemas
xlive_protocol.json runtime protocol
inference_transformers.py minimal Transformers Dual inference
License
X-Live Dual is released under the Apache License 2.0. Other runtime components retain their respective licenses.
- Downloads last month
- 23