Executable programs and extensions

What is Crane? Run LLM, OCR and audio models behind a local Rust API

Crane connects local AI models to Rust applications

Crane is a Rust project built on Hugging Face Candle for running text, OCR1, and speech models and connecting them to applications through the crane-serve HTTP API2. Developers embedding inference3 in Rust or managing their own server can verify the chat path with a small Qwen3.5 model, then add the capabilities they need.

An app that adds chat, receipt OCR, and speech transcription can end up with conflicting Python dependencies or separate environments for each feature. Crane brings text, image, and audio examples together in a Rust/Candle repository and exposes them through the local crane-serve API. Start with one text model, verify requests between the app and server, then add other models so issues remain easier to isolate.

Rust catches many errors at compile time and makes it convenient to package an application as an executable. Candle provides tensor operations and model components in Rust. These are development and deployment benefits; changing languages alone does not make a model faster or guarantee support for every checkpoint4.

Requirements and key details
  • Crane is a Candle-based Rust project that connects text, image, and speech capabilities to applications through an HTTP API.
  • Verify the chat server first with Qwen/Qwen3.5-0.8B, then set the client to http://127.0.0.1:8080/v1 and model name crane-local.
  • Bonsai 2 Prism GGUF is documented for CPU and NVIDIA CUDA. Check project-level Metal support separately from support for a particular model.

How Crane differs from other local runtimes

Ollama simplifies downloading and running models behind an API. MLX5 is a compute framework for Apple Silicon, with applications such as oMLX built on top of it. Crane provides Rust model implementations through Candle and CPU6, Metal7, and CUDA8 execution paths. It generally loads one model per process, so separate chat and speech models can run as separate servers on different ports.

An existing program sends requests to crane-serve and receives responses through an OpenAI-compatible chat API. Crane does not replace desktop-app features such as file management or conversation history. Project-level Metal support does not mean every model runs on Metal, so check the device support for each checkpoint.

A small computer showing a chat screen, with a microphone and a photo beside it
Adding speech to an app also requires checking the speech model and request path.

Pin the commit and build for your device

The build below pins the commit reviewed on September 23, 2026. You need the Rust toolchain; macOS also needs Xcode Command Line Tools, while Linux with NVIDIA CUDA needs a compatible CUDA toolkit. Choose one Cargo command for your device rather than running all three.

Choose Metal and Accelerate on Apple Silicon Mac, CUDA on Linux with an NVIDIA GPU9, or the CPU build for a first check without a GPU. Model weights are not part of compilation, so download a model separately after building the executable.

Clone the repository and pin its version
git clone https://github.com/lucasjinreal/Crane.git
cd Crane
git checkout --detach 99a60887bdca16b4852b7bc953ca03c1df374e88
Start from the commit reviewed for this guide.
Build for Apple Silicon Mac
cargo build --release -p crane-serve --features "metal,accelerate"
Choose this command on Mac.
Build for NVIDIA CUDA
cargo build --release -p crane-serve --features cuda
Use on Linux with a compatible CUDA toolkit.
Build for CPU
cargo build --release -p crane-serve
Choose this to check functionality without a GPU.
Concept illustration of differently shaped wooden blocks and a fitting jig, with a laptop and graphics card behind them
Choose an execution path for the model file; device support varies by model.

Check the chat path with a small Qwen model

The server executable needs model weights separately. Start with Qwen/Qwen3.5-0.8B, which is listed in the README and model card. This checkpoint also includes a vision encoder, but the first test is a text request summarizing meeting notes, so use the --text-only server option. Enabling one capability at a time makes failures easier to isolate.

Use hf download and confirm that the model directory contains configuration, tokenizer, and weight files. If uv is already installed, uvx hf runs the download tool in an isolated uv-managed environment, so a separate Python virtual environment10 is not needed. Otherwise, follow Hugging Face's OS-specific CLI11 installation instructions.

Download the official model files
uvx hf download Qwen/Qwen3.5-0.8B --local-dir models/Qwen3.5-0.8B
Run this from the Crane directory and wait for the download to finish.

Keep the test server accessible only on this computer

The --model-name crane-local value is the name used in API requests, and --context 4096 sets the context limit for this test. Setting --host 127.0.0.1 accepts requests from this computer only. Crane's default host is 0.0.0.0, which listens on all network interfaces, so local testing should expose only the required scope.

Check the server log for its address and model-loading status. If the interface does not open automatically, visit http://127.0.0.1:8080/ in a browser; --ui provides the web interface. First test whether a short note receives a complete answer. If it fails, inspect the model path, text-only option, and logs before adding longer inputs or OCR.

Qwen3.5 text chat server
./target/release/crane-serve --model-path models/Qwen3.5-0.8B --model-type qwen3_5_vl --text-only --model-name crane-local --host 127.0.0.1 --port 8080 --context 4096 --ui
Use the downloaded model directory and omit vision components with --text-only.

Send requests from an app through the OpenAI-compatible API

Calling the API directly with curl separates server checks from client configuration. curl -N displays streamed content without buffering, so you can see the first token12 and subsequent output. The request's model value must match crane-local from the server command. Supported Qwen templates can disable thinking mode with enable_thinking set to false.

Set the OpenAI-compatible client base URL to http://127.0.0.1:8080/v1 and the model name to crane-local. This example accepts unauthenticated requests only on localhost. If the app requires an API key and you enter a placeholder such as local, it does not become a server password or enable authentication. Use a non-sensitive note or short code explanation to verify the app reaches the same server as the browser test.

Request a streaming response
curl -N http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"crane-local","messages":[{"role":"user","content":"Say hello in one short sentence."}],"stream":true,"max_tokens":256,"temperature":0,"chat_template_kwargs":{"enable_thinking":false}}'
Keep the server running and execute this in another terminal to see response chunks arrive.

Add OCR, ASR, and TTS after chat works

After confirming chat, review the repository's PaddleOCR-family, Qwen3-ASR, and Qwen3-TTS paths separately. OCR reads text from images, ASR13 converts speech to text14, and TTS15 produces audio from text, so they use different model types and inputs. For meeting transcription, process a short sample through a separate server using the model type and API format in its README. Separate ports reduce the chance that changing one feature interrupts another.

Use a non-sensitive sample before real recordings or receipts. Test separately whether OCR reads image text, ASR captures Korean speech, and TTS produces the needed language. A model's startup log and output quality are separate checks.

Recheck file format and GPU support for Bonsai 2

The Bonsai 2 Prism release is a designated GGUF16 containing PTQ1_0 or PQ2_0 ternary weights, not an ordinary GGUF. Crane adds an implementation that reads this special type and applies the TernaryLinear path. Use the specified Prism file rather than substituting a regular Q4 GGUF.

The official instructions describe CPU and NVIDIA CUDA execution for Bonsai 2; they do not say that Qwen3.5's Metal path applies unchanged. A successful Crane build on Mac does not guarantee Mac GPU acceleration for this model. Check memory use with the selected Prism file and context 4096 rather than estimating from the 27B parameter count alone.

Switch the server to Bonsai 2 GGUF
./target/release/crane-serve \
  --model-path /absolute/path/Ternary-Bonsai-2-27B-PTQ1_0.gguf \
  --model-name bonsai-local --host 127.0.0.1 --port 8080 \
  --context 4096 --ui
Stop the existing server with Ctrl+C, then run this CPU/CUDA example. Change the file path and client model name.

Compare runtimes using the same task and conditions

For comparison with another runtime17, use the same meeting note and separate initial model loading and warm-up from the main measurements. After warm-up, run the same request three times and record the median, with time to first token18, generation speed, and total completion time kept distinct. This helps locate differences in input processing versus answer generation.

Match thinking mode, output limit, model, quantization19, and context length20 before attributing a speed difference to the backend. Record new requests separately from continuing conversations, and note different formats such as MLX and GGUF. Faster output is not a reason to switch if meeting summaries omit decisions; also consider whether required tasks complete reliably and environment-management time decreases.

A desk with a connected laptop and computer beside a run log notebook and stopwatch
Record latency and answer quality side by side for the same request.

Terminology notes

  1. OCR — The process of recognizing characters in images or scanned documents and turning them into text. Table layout and reading order still need the original image to verify.

    Back to the text
  2. API — A defined interface that lets other code call a program’s functions.

    Back to the text
  3. Inference — The process of using a trained model to compute an output for an input. Here, local inference means running the model on the user’s device.

    Back to the text
  4. Checkpoint — A file containing saved model weights and related state. Versions or tasks in one model family may use different checkpoints.

    Back to the text
  5. MLX — Apple’s machine-learning framework, which runs models using memory shared by the CPU and GPU on Apple Silicon.

    Back to the text
  6. CPU — The central processor that runs the operating system and general-purpose instructions; in AI workloads it also handles tasks such as preprocessing and data movement.

    Back to the text
  7. Metal — Apple’s low-level technology for graphics and parallel GPU computation.

    Back to the text
  8. CUDA — A software platform for general-purpose computing on NVIDIA GPUs.

    Back to the text
  9. GPU — A processor designed to handle many calculations in parallel. It performs model computations during AI inference.

    Back to the text
  10. Python virtual environment — An isolated space for installing Python packages per project, helping reduce package-version conflicts.

    Back to the text
  11. CLI — Short for Command-Line Interface: operating a program by entering commands in a terminal.

    Back to the text
  12. Token — A unit into which a model divides input or output for processing.

    Back to the text
  13. Automatic Speech Recognition — Technology that recognizes spoken language in audio and converts it to text.

    Back to the text
  14. Speech-to-Text — The task or system that converts spoken audio into text. The term is often used interchangeably with Automatic Speech Recognition (ASR).

    Back to the text
  15. Text-to-Speech — Technology that converts text into spoken audio with pronunciation and prosody.

    Back to the text
  16. GGUF — A file format for model data, widely used by llama.cpp-based tools.

    Back to the text
  17. Runtime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.

    Back to the text
  18. Time to First Token — The time from sending a request until its first output token arrives.

    Back to the text
  19. Quantization — A way to represent model weights or values with fewer bits, reducing storage and memory use. The coarser representation can also affect accuracy.

    Back to the text
  20. Context window — The token span of input and generated content a model can handle in one request. The supported limit and memory use depend on the model and runtime settings.

    Back to the text

Frequently asked questions

What should you check first in this article?
Crane is a Rust project built on Hugging Face Candle for running text, OCR, and speech models and connecting them to applications through the crane-serve HTTP API. Developers embedding inference in Rust or managing their own server can verify the chat path with a small Qwen3.5 model, then add the capabilities they need.
How much memory does it need?
The official instructions describe CPU and NVIDIA CUDA execution for Bonsai 2; they do not say that Qwen3.5's Metal path applies unchanged. A successful Crane build on Mac does not guarantee Mac GPU acceleration for this model. Check memory use with the selected Prism file and context 4096 rather than estimating from the 27B parameter count alone.
Where can you check the conditions and sources?
The server executable needs model weights separately. Start with Qwen/Qwen3.5-0.8B, which is listed in the README and model card. This checkpoint also includes a vision encoder, but the first test is a text request summarizing meeting notes, so use the --text-only server option. Enabling one capability at a time makes failures easier to isolate.