How Much To Run AI

Run and serve a local model with TensorFold

Set up TensorFold for a supported model and GPU. Read the Intel Arc Qwen3.8-27B benchmark and compare memory, prompt time and complete running costs.

Last updated: 2026-11-23

TensorFold serves supported language models from a native Zig binary. The current 1.x path loads checkpoints and runs GPU kernels directly, without installing Python or MLX to serve a model. Choose a runtime build and weight format together. An MLX-format checkpoint, for example, can work with TensorFold’s own native Metal loader.

Install the native engine and try one short request

Start with the 1.3.4 quickstart. On Apple Silicon, install with Homebrew and start with the small documented checkpoint:

brew install ashhart/tensorfold/tensorfold
tensorfold pull mlx-community/Qwen3.5-2B-MLX-4bit@93760be4f1f69842a46bc13dbdc0f19e291392a3
tensorfold serve mlx-community/Qwen3.5-2B-MLX-4bit --name local-model --context 8192 --no-thinking

In another terminal, send a short prompt to the local server:

curl -fsS http://127.0.0.1:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"local-model","messages":[{"role":"user","content":"Say hello in one sentence."}],"max_tokens":128,"temperature":0}'

Choose the build and checkpoint for your GPU

HardwareStarting pointWhat to check before downloading
Apple SiliconThe Homebrew install uses native Metal. The 27B recipe specifies TensorFold’s MLX 4-bit weights.The recipe documents M5 Max and M3 Ultra validation. Check free unified memory at the context you intend to serve.
NVIDIA on LinuxUse the release archive for your CPU architecture and verify its published checksum. The 1.3.4 quickstart calls for glibc 2.28 and NVIDIA driver R580 or newer for CUDA 13.The Qwen recipe lists MLX affine, selected ModelOpt NVFP4 and FP8 exports, and EXL3 packs. Check the card and exact format before downloading a larger model.
Intel Arc Pro B70Build the community XPU backend for Linux and use the B70 recipe’s pinned GPTQ checkpoint.Check for the Intel xe driver, Level Zero runtime, Zig 0.17, ocloc, a C++17 compiler and oneDNN nGEN headers.

The Qwen3.8-27B recipe and supported-model list give checkpoint names. TensorFold is Apache 2.0 software, and weights have their own license terms. The same underlying Qwen model can be packed differently for each backend. Write down the repository and revision so you can restore the exact package later.

On the B70, the XPU build guide explains why the source build is separate. The build compiles and embeds Intel-specific kernels. The standard NVIDIA archive has a different backend. Use the Arc recipe as the starting point and keep the tokenizer files that ship with its GPTQ checkpoint. The recipe documents tokenizer differences for some scripts and combining marks. If your workload includes Hindi or Thai, compare a real sample before assuming the English code benchmark describes its token count.

Check the server before connecting a client

Confirm that the model loads, then request /v1/models on the port the process prints. Use the returned model name in your client. The quickstart uses port 8080. The Arc recipe runs a separate example at 8081. A plain text reply from the loopback address confirms that the server and tokenizer loaded and that the requested name works. Test structured output or client tool calls separately if your application uses them.

For interactive testing, tensorfold chat can start a local session or connect to an existing server. TensorFold Web is a separate optional application. The release launcher can offer to install it through uv. Choose it if you need the browser interface. A client that already calls Chat Completions can use the native server directly.

Read the Arc Pro B70 numbers by prompt length

The 1.3.4 release improves plain decode attention for Qwen3.8-27B on Intel Arc Pro B70. The maintainer reports 1.8–2.0% faster plain decoding at about 8K input tokens, 14.7–16.0% at about 30K and 39.8–42.2% at 121,022. The tested token hashes matched across the old and new paths. Drafted decode speed stayed level in this release comparison.

Upper end of the reported plain-decode improvement on Arc Pro B70: 2.0% at about 8K, 16.0% at about 30K and 42.2% at 121,022 input tokens.

Maintainer’s version comparison for Qwen3.8-27B. The chart shows the upper ends of the reported improvements in output generation.

The underlying pull request gives absolute results for code prompts with INT8 KV cache. The optimized branch produced 32.74 tokens/s at 7,588 input tokens, 29.48 at 28,946 and 20.77 at 121,022. The 121K result is the largest relative gain and still the slowest of the three in absolute output speed.

DFlash2 proposes draft tokens that the target model checks. Compare it with plain decode using the same prompt and cache, because acceptance and verification costs vary with the workload. A project issue with a separate B70 test records a long code prompt where plain decode was faster than drafted decode in that build. A community four-card report ran one model server per B70, so its aggregate throughput describes four replicas.

Repeat the Arc comparison with your own prompts

Start with a single stream and a short prompt. For a matched run, keep the checkpoint and tokenizer, cache precision, prompt, output limit and sampling settings fixed. The B70 uses BF16 KV by default. The reported INT8 runs use the XPU cache option, which the backend guide says can change near-tie answers compared with BF16. Compare old and new builds within one cache precision before comparing the precisions themselves.

Make three prompts using the same kind of work, such as code review with a small, medium and large set of files. To approximate the published comparison, aim for about 8K, 30K and 121K input tokens. Use the same instruction and ask for the same amount of output. Count the rendered input with /v1/tokenize and use the context setting to leave room for both the prompt and reply. A launch sized for 16K, like the example recipe, cannot accept a 121K prompt. A long prompt may also require reducing the number of available stream slots so its cache fits on the card.

For each prompt, test plain and drafted generation with the drafter installed and the same server build. In the API reference, "draft": false selects the serial reference. Record actual output tokens and finish reasons so a short stopped answer does not look faster than a completed one. When comparing alignment, the native response can return token IDs for a deterministic request. Compare IDs within the same tokenizer and cache mode.

For a closer match, follow the release benchmark receipt. The single-stream test set the context to 132,096, disabled the prompt cache, used greedy generation with thinking off and requested 256 new tokens. The test alternated the builds in A–B–B–A order, with one warm-up and three measured requests on each pass. If your goal is production capacity, run a separate concurrent test and measure output tokens over wall time for the whole group. That result includes each request’s prompt-processing time.

Record time to first token, output tokens per second and total response time separately. The native response documents prefill and first-token timing, generation statistics and draft acceptance. Keep cold and repeated prompts in separate rows. With prefix caching enabled, inspect the cached-token count, since a warm result can spend less time processing the prompt. Run a few repeats per mode and report a median for each input length. That gives you a local baseline to compare with the Arc release notes.

Budget prompt time, GPU memory and completed requests

Plan space for the exact checkpoint, KV cache, runtime buffers and any drafter. Start at a short context. A fresh long prompt adds prefill time before the first token, while a repeat can reuse cached work. Time one fresh request and one follow-up at the concurrency you expect, then log first-token time, decode speed and whether the response completed the task.

For a rented server, a $1.20/hour reservation that takes 15 minutes costs $0.30. At ten accepted results the compute cost is $0.03 per result, before storage or network charges. For hardware you own, use wall power and the full session duration, alongside the cost of keeping the machine available. The Qwen3.8-27B memory and backend guide and the running-cost calculator help compare that plan with other ways to run the model.