DEV Community

SparkLLM
SparkLLM

Posted on

Spark X2.6 for Local Chinese-to-English Translation, With a Recorded Math Check

Watch the English recording: https://youtube.com/shorts/cBm3AIhdxKI

Ask a model to translate one Chinese sentence and return only the English. It is a small task, but a useful way to make a local language-model application concrete: the instruction, the original text and the generated result can all be checked together.

In this run, Spark X2.6 received “开源让开发者一起构建。” and produced:

Open source enables developers to build together.

We recorded the generation through the open-source Spark-MLX-LLM project on a Linux CPU. The same run also returned 2226 for 53 × 42.

A specific translation task

Spark X2.6 actual translation output

The full prompt was:

Translate into English. Output only the translation: 开源让开发者一起构建。
Enter fullscreen mode Exit fullscreen mode

The result is a complete English sentence that carries the source sentence's key ideas: open source, developers and building together. The recording shows the prompt and the generated words appearing in the terminal.

This is the application demonstrated here: a local model follows an explicit output instruction to turn a Chinese sentence into English. Keeping the source text and generated translation together makes this individual result straightforward to inspect.

A second check from the same run

Spark X2.6 actual arithmetic output

The arithmetic prompt was:

只输出计算结果:53 × 42 =
Enter fullscreen mode Exit fullscreen mode

Spark X2.6 returned 2226, which is the correct result for this multiplication. These two recorded prompts establish what happened in this run. Evaluating broader translation quality or mathematical reliability would require a defined task set and evaluation method.

How the open-source project was used

Spark X2.6 is the model performing the tasks. Spark-MLX-LLM provides the open-source loading and execution path used in this demonstration. We called its public spark_mlx_llm.load function and then submitted the prompts through MLX LM's streaming generation interface.

The checkpoint was the abenzerps community MLX 4-bit conversion of Spark-X2.6-4B, based on XHToken/Spark-X2.6-4B. The quantized weights remain packed in their 4-bit representation. The run used dtype="float32" for floating-point runtime parameters on a Linux x86_64 CPU.

That combination matters when reproducing the example. The model identifier, checkpoint format, source revision and runtime environment together describe the actual path used to obtain these outputs.

Recorded timing and the edited video

Translation took 403.37 seconds in this environment; arithmetic took 344.87 seconds. The short video cuts waiting intervals while retaining real prompts, generated text and the completed results. On-screen timing labels refer to the actual run, not the edited clip length.

The video also retains separately labeled X2.5 translation footage. That earlier result uses “allows”; the X2.6 result in this run uses “enables.” The labels keep the two recordings attributable to their respective models.

Reproducing the demonstrated route

Start with the Python API example in the fixed Spark-MLX-LLM source revision, together with the community checkpoint revision used here.

This run selected the CPU device and called the public loader with dtype="float32", lazy=True and strict=True. Every model parameter was evaluated before generation began. The generation settings were temp=0, seed=1 and enable_thinking=False in the chat template.

Use the same prompts, compare the complete responses, and record timing in your own environment. The concrete result here is a local Chinese-to-English translation and a correct response to one multiplication prompt, with an open-source path connecting the model checkpoint, input and recorded output.

Top comments (0)