Instructions to use ferrotorch/serialize-parity-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ferrotorch/serialize-parity-v1 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ferrotorch/serialize-parity-v1", filename="gguf/SmolLM2-135M-Instruct-Q8_0.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ferrotorch/serialize-parity-v1 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ferrotorch/serialize-parity-v1:Q8_0 # Run inference directly in the terminal: llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ferrotorch/serialize-parity-v1:Q8_0 # Run inference directly in the terminal: llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ferrotorch/serialize-parity-v1:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ferrotorch/serialize-parity-v1:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0
Use Docker
docker model run hf.co/ferrotorch/serialize-parity-v1:Q8_0
- LM Studio
- Jan
- Ollama
How to use ferrotorch/serialize-parity-v1 with Ollama:
ollama run hf.co/ferrotorch/serialize-parity-v1:Q8_0
- Unsloth Studio new
How to use ferrotorch/serialize-parity-v1 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ferrotorch/serialize-parity-v1 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ferrotorch/serialize-parity-v1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ferrotorch/serialize-parity-v1 to start chatting
- Docker Model Runner
How to use ferrotorch/serialize-parity-v1 with Docker Model Runner:
docker model run hf.co/ferrotorch/serialize-parity-v1:Q8_0
- Lemonade
How to use ferrotorch/serialize-parity-v1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ferrotorch/serialize-parity-v1:Q8_0
Run and chat with the model
lemonade run user.serialize-parity-v1-Q8_0
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf ferrotorch/serialize-parity-v1:Q8_0# Run inference directly in the terminal:
llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf ferrotorch/serialize-parity-v1:Q8_0# Run inference directly in the terminal:
./llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf ferrotorch/serialize-parity-v1:Q8_0# Run inference directly in the terminal:
./build/bin/llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0Use Docker
docker model run hf.co/ferrotorch/serialize-parity-v1:Q8_0
ferrotorch/serialize-parity-v1
Phase G.3 of ferrotorch's real-artifact-driven development
(#1169). Pins canonical references for ferrotorch-serialize's
four format loaders/exporters so the rust crate's parsers and
emitters can be verified byte-exact against the upstream
toolchains they target.
Targets
.pthload βresnet18-pth/resnet18-5c106cde.pthis the official torchvision checkpoint (https://download.pytorch.org/models/resnet18-5c106cde.pth).reference_state_dict/<key>.bincarries each tensor as[u32 ndim][u32 shape...][f32 bytes]. The rust harness dumps the same per-tensor binaries viaferrotorch_serialize::load_pytorch_state_dictand compares byte-exact (max_abs = 0).SafeTensors round-trip β
safetensors-rt/resnet18.safetensorsis the same resnet18 state_dict re-saved viasafetensors.torch.save_file. References are the same per- tensor binaries as the .pth target. The rust harness compares byte-exact (max_abs = 0).GGUF load β
gguf/SmolLM-135M-Instruct-Q4_K_M.ggufis the upstreamunsloth/SmolLM-135M-Instruct-GGUFcheckpoint.reference_dequant/<name>.bincarries dequantized f32 tensors for a deterministic stride-sampled subset of layers, produced by python'sgguf.GGUFReader. The rust harness reproduces those under max_abs <= 1e-4 (Q4_K group scaling has a known noise floor between implementations).ONNX export β
onnx-mlp/carries:mlp_weights.binβ fixed-seed (torch.manual_seed(42)) weights for aLinear(4 -> 8) + ReLU + Linear(8 -> 2)MLP. The rust side reads these so its in-memory MLP matches torch's bit-for-bit before export.input_{zeros,ones,random}.binβ three fixed inputs.torch_forward_{zeros,ones,random}.binβ reference forward outputs fromtorch.nn.Sequential.
The rust harness builds the same MLP from
mlp_weights.bin, exports it viaferrotorch_serialize::export_onnx, dumps the rust-side ferrotorch forward, and the python verifier loads the rust-emitted .onnx viaonnxruntime.InferenceSessionand asserts cosine_sim >= 0.9999 + max_abs <= 1e-5 across (rust-onnx vs rust-ferrotorch) AND (rust-onnx vs torch).
Provenance
- Pin script:
scripts/pin_pretrained_serialize_fixtures.py. - Verifier:
scripts/verify_serialize_inference.py. - Rust dumps:
ferrotorch-serialize/examples/serialize_{pth,safetensors,gguf,onnx_export}_dump.rs. - Cargo test wrapper:
ferrotorch-serialize/tests/conformance_format_parity.rs. - Tracking issue: https://github.com/dollspace-gay/ferrotorch/issues/1169.
- SHA-256 of
bundle.tar(pinned inferrotorch-hub/src/registry.rs):7c20267db5706421e7367c4d275346114a43ff6d55e6ff1aa11069bc45562296.
Upstream licenses
- resnet18 weights β BSD-3-Clause (torchvision).
- SmolLM2-135M-Instruct-GGUF β Apache-2.0 (upstream
unslothmirror of HuggingFace'sHuggingFaceTB/SmolLM2-135M-Instruct). - ferrotorch fixtures themselves β Apache-2.0 / MIT.
- Downloads last month
- 6
8-bit
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf ferrotorch/serialize-parity-v1:Q8_0# Run inference directly in the terminal: llama-cli -hf ferrotorch/serialize-parity-v1:Q8_0