Rust crate for local StarVector inference on Candle.
- Models:
starvector-1b-im2svg,starvector-8b-im2svg - Weight formats:
safetensors,GGUF - Devices:
CPU,CUDA(manual acceptance)
Effective matrix:
1B + safetensors1B + GGUF8B + safetensors8B + GGUF
1B:CLIPvision +BigCodedecoder +BatchNormadapter8B:SigLIPvision +StarCoder2decoder +LayerNormadapterGGUFpath uses quantized runtime for both1Band8B.
cd D:\starvecntor\mk\starvector-rs
cargo buildCUDA build:
cd D:\starvecntor\mk\starvector-rs
cargo build --features cuda1B safetensors:
cargo run -- infer --model-dir ..\..\models\starvector-1b-im2svg --image ..\..\star-vector\assets\examples\sample-18.png --device cpu --max-new-tokens 648B safetensors:
cargo run -- infer --model-dir ..\..\models\starvector-8b-im2svg --image ..\..\star-vector\assets\examples\sample-18.png --device cpu --max-new-tokens 648B GGUF:
cargo run -- infer --model-dir ..\..\models\starvector-8b-im2svg --weights-gguf ..\..\models\starvector-8b-im2svg-full-q4_0.gguf --image ..\..\star-vector\assets\examples\sample-18.png --device cpu --max-new-tokens 64CLI contract:
- Prints SVG to
stdout. - Writes SVG to file when
--outputis provided. - Uses
</svg>stop sequence. --device cudais equivalent to--device cuda:0.- If binary is built without
cudafeature,--device cuda[:idx]fails explicitly.
Default (cargo test, no env):
- No GPU required.
- No Python required.
- No local model artifacts required.
- Includes metadata/profile/mode selection and typed error mapping checks.
Opt-in local model tests:
STARVECTOR_RUN_LOCAL_MODEL_TESTS=1- Optional model path overrides:
STARVECTOR_MODEL_DIRSTARVECTOR_1B_MODEL_DIRSTARVECTOR_8B_MODEL_DIR
Opt-in Python parity tests:
STARVECTOR_RUN_LOCAL_MODEL_TESTS=1STARVECTOR_RUN_PYTHON_ORACLE=1
Opt-in GGUF smoke:
STARVECTOR_RUN_1B_GGUF_CPU=1STARVECTOR_RUN_1B_GGUF_CUDA=1STARVECTOR_RUN_8B_GGUF_CPU=1STARVECTOR_RUN_8B_GGUF_CUDA=1STARVECTOR_1B_GGUF=<path>STARVECTOR_8B_GGUF=<path>
Opt-in safetensors smoke:
STARVECTOR_RUN_SAFE_1B_CUDA=1STARVECTOR_RUN_SAFE_8B_CPU=1STARVECTOR_RUN_SAFE_8B_CUDA=1
Recommended manual flow before claiming full 8B support:
8B GGUF CPUload + short generate smoke8B GGUF CUDAload + short generate smoke8B safetensors CPUload + short generate smoke8B safetensors CUDAload + short generate smoke- Explicit mismatch checks:
8B model_dir + 1B GGUF1B model_dir + 8B GGUF
CUDA acceptance is manual and machine-dependent. It is not required for default CI-like test execution.
cd D:\starvecntor\mk\starvector-rs
cargo fmt --check
cargo clippy -- -D warnings
cargo test
cargo buildApache-2.0