Practical overview
When it fits
Use Xturing when you want a Python-based workflow connecting dataset preparation, fine-tuning, evaluation and inference for open-source LLMs.
Who it is for
- Developers building or maintaining language-model pipelines.
- Teams adapting open-source LLMs to their own datasets.
- Practitioners who need model evaluation and inference within a Python workflow.
Documented uses
- Prepare instruction data and fine-tune a language model.
- Generate text using a personalized model.
- Evaluate a causal language model on a dataset using perplexity.
- Run model workflows locally or in a private cloud.
Requirements & limits
The repository is public and identifies the project license as Apache-2.0. The documented installation uses pip install xturing.
- The current README specifies Transformers 4.36 or later and advises against Transformers 5.x because the INT8/INT4 engines depend on loading arguments removed in version 5.
- The documentation ranges from a CPU-friendly Qwen 0.6B example to large GPT-OSS models that require significant resources.
- The examples expose Python API workflows rather than a hosted model service.
- Perplexity is the evaluation metric explicitly identified in the README.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Fine-tune a small Qwen model and generate text
Use an instruction dataset to fine-tune the documented Qwen 0.6B LoRA checkpoint, then generate a response.
Before you start
- Python environment with xTuring installed using pip install xturing.
- Transformers version 4.36 or later; the README advises against version 5.x.
- The example Alpaca-format dataset at ./examples/models/llama/alpaca_data.
Steps
Load the dataset with InstructionDataset("./examples/models/llama/alpaca_data").
Create the model with BaseModel.create("qwen3_0_6b_lora").
Call model.finetune(dataset=dataset).
Call model.generate(texts=["Explain quantum computing for beginners."]) and print the output.
Expected outcome
The example produces generated text from the fine-tuned model.
Guide limitations
- This is the documented example workflow; it does not establish performance or compatibility beyond its stated requirements.
- Transformers 5.x is not recommended for the current INT8/INT4 loading engines.
Evaluate a causal language model with perplexity
Run the documented dataset evaluation and retrieve a perplexity result.
Before you start
- Python environment with xTuring installed using pip install xturing.
- Transformers version 4.36 or later; the README advises against version 5.x.
- An instruction dataset accessible to InstructionDataset.
Steps
Load a dataset with InstructionDataset, using the documented Alpaca data path or another dataset path.
Load a model with BaseModel.create("gpt_oss_20b").
Run result = model.evaluate(dataset).
Print or otherwise use the returned result as the model's perplexity.
Expected outcome
The example returns a perplexity value for the model evaluated on the selected dataset.
Guide limitations
- Perplexity is the evaluation metric identified in the README.
- The GPT-OSS model examples require significant resources.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 11 October 2026
- Original website title
- stochasticai/xTuring · Official homepage title · retained in its source language

