█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

Cactus

टेक्स्ट, विज़न और स्पीच मॉडल को फ़ोन, वियरेबल और रोबोट पर चलाने के लिए बना चार-परत वाला इन्फ़रेंस स्टैक — quantizer, kernels, graph और engine

Local RuntimesFreemium
भाषा
C++
लाइसेंस
Source-available (free for individuals, non-profits and organisations under $2M funding and revenue; commercial licence required above)
कवरेज
1 story
$brew install cactus-compute/cactus/cactus
संक्षेप में

Cactus क्या है?

Cactus टेक्स्ट, विज़न और स्पीच मॉडल को फ़ोन, वियरेबल और रोबोट पर चलाने के लिए बना चार-परत वाला इन्फ़रेंस स्टैक — quantizer, kernels, graph और engine. यह Models & Inference टूल्स की Local Runtimes श्रेणी में आता है; ओपन सोर्स है, C++ में लिखा गया है और Source-available (free for individuals, non-profits and organisations under $2M funding and revenue; commercial licence required above) लाइसेंस के तहत है।

सारांश

Cactus एक हाइब्रिड edge-cloud AI इंजन है, जो मोबाइल डिवाइस और वियरेबल को ध्यान में रखकर बनाया गया है। किसी मौजूदा runtime को wrap करने के बजाय, यह चार stacked layers के रूप में बना है, जिन्हें प्रोजेक्ट खुद maintain करता है: Cactus Quants, एक rotation-and-codebook quantization scheme जो weight tensors को 4-bit से 1-bit तक ले जाती है; Cactus Kernels, matmul, attention, convolution, quantization, DSP और image processing के लिए हाथ से लिखे गए ARM NEON SIMD kernels; Cactus Graph, एक zero-copy computation graph जिसे tensor work के लिए सीधे चलाया जा सकता है; और Cactus Engine, जो इन सबके ऊपर text, speech और vision के लिए OpenAI-compatible APIs देता है।

इंजन का C API chat completion, streaming, tool calling, transcription, embeddings, RAG और एक vector index को कवर करता है। हर generation टेक्स्ट के साथ telemetry भी लौटाता है: time to first token, prefill और decode tokens per second, peak RAM, और एक model confidence score। यही confidence score "hybrid" वाले हिस्से को चलाता है: cloud handoff चालू होने पर, जिस request पर लोकल मॉडल भरोसा नहीं कर पाता, उसे hosted model पर भेजा जा सकता है, और response बताता है कि handoff हुआ या नहीं।

Cactus source-available है, OSI open source नहीं। इसका लाइसेंस व्यक्तियों, छात्रों, शैक्षणिक संस्थानों, रजिस्टर्ड non-profits और उन संगठनों को मुफ़्त उपयोग देता है जिनकी कुल funding $2M से कम है और सालाना gross revenue भी $2M से कम है; इन सीमाओं से ऊपर वाले किसी भी व्यक्ति को Cactus Compute, Inc. से commercial लाइसेंस लेना होगा। Bindings Swift, Kotlin, Flutter, React Native, Python और Rust के लिए उपलब्ध हैं।

यह क्या करता है

  • 4-bit से 1-bit तक rotation-and-codebook quantization (CQ), जिसमें mixed-precision CQ3.26 और CQ2.54 formats शामिल हैं, और हर bit width के लिए प्रकाशित accuracy tables
  • स्टैक के लिए लिखे गए ARM NEON SIMD kernels, साथ में CPU और Metal backends जो अपने आप चुने जाते हैं
  • OpenAI-compatible engine API, जो chat, streaming, tool calling, transcription, embeddings, vision और RAG के लिए built-in vector index को कवर करता है
  • Automatic cloud handoff: configurable confidence threshold से नीचे की requests को hosted model पर भेजा जाता है, और response बताता है कि ऐसा हुआ या नहीं
  • `cactus convert` Hugging Face मॉडल को CQ weights में बदलता है (Liquid, Gemma, Whisper, Parakeet और Qwen families टेस्ट किए गए हैं), और `cactus download` pre-converted bundles खींचता है
  • Swift, Kotlin, Flutter, React Native, Python और Rust के bindings, ताकि वही engine एक native iOS ऐप और एक Android ऐप दोनों को चलाए

शुरू करें

सबसे तेज़ झलक Mac पर Homebrew CLI से मिलती है; repository से build करने पर पूरा command set और language bindings मिलते हैं।

Homebrew से आज़माएँ

macOS पर दो commands से एक मॉडल लोकली चल जाता है।

bashbash
brew install cactus-compute/cactus/cactus
cactus run

Repository से build करें

Ubuntu या Debian पर पहले build prerequisites install करें, फिर clone करें और setup script को source करें, ताकि `cactus` command आपके path पर आ जाए।

bashbash
sudo apt-get install python3.12 python3.12-venv python3-pip cmake \
  build-essential libcurl4-openssl-dev

git clone https://github.com/cactus-compute/engine && cd engine
source ./setup

मॉडल चलाएँ, convert करें और serve करें

`cactus run` अगर मॉडल पहले से मौजूद नहीं है तो उसे download या convert कर देता है। `cactus convert` किसी भी Hugging Face मॉडल को CQ weights में बदलता है, और `cactus serve` उसके आगे एक OpenAI-compatible HTTP server लगा देता है।

bashbash
# chat with a model, choosing the quantization width
cactus run google/gemma-4-e2b-it --bits 4 --backend metal

# vision and audio inputs use the same command
cactus run <model> --image photo.jpg
cactus transcribe --file meeting.wav --language en

# convert your own checkpoint
cactus convert <hf-name> --bits 3

# OpenAI-compatible server on 127.0.0.1:8080
cactus serve <model> --port 8080 --confidence-threshold 0.7
Terminal capture of cactus run building the Cactus library, loading a local Qwen3 0.6B model and answering a chat message, with token count, latency and 58 tok/s throughput printed after the reply
cactus run building the library, loading a local model and chatting in the terminalCactus engine repository ↗

C से engine को call करें

Engine एक weights folder और JSON chat messages लेता है, और completion को उस buffer में लिखता है जो आपके पास है। वही handle streaming, tool calling और transcription को भी संभालता है।

टेक्स्टटेक्स्ट
#include "cactus_engine.h"

cactus_model_t model = cactus_init(
    "path/to/weight/folder",
    "path to txt or dir of txts for auto-rag",
    false
);

const char* messages = R"([
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Summarise this in one line."}
])";

char response[4096];
int result = cactus_complete(
    model, messages, response, sizeof(response),
    R"({"max_tokens": 50})",
    nullptr, nullptr, nullptr, nullptr, 0
);

अपने डिवाइस पर इसे मापें

CLI में एक benchmark आता है जो prefill और decode throughput, image encode time, transcription latency और peak RAM दिखाता है, और इसे कनेक्टेड फ़ोन पर भी चलाया जा सकता है।

bashbash
cactus benchmark
cactus benchmark --ios
cactus benchmark --android

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • मोबाइल ऐप के अंदर एक assistant लगाएँ जो offline जवाब दे और सिर्फ़ तब hosted मॉडल का सहारा ले जब लोकल मॉडल अनिश्चित हो
  • किसी टेक्स्ट, विज़न या स्पीच मॉडल को वियरेबल या रोबोट की memory सीमा में फिट करें, हर task के लिए मापे गए आंकड़ों के साथ accuracy और bit width के बीच संतुलन बनाते हुए
  • Swift, Kotlin, Flutter या React Native bindings के ज़रिए iOS और Android ऐप को एक ही inference व्यवहार दें
  • हर function call को server तक भेजने के बजाय एक छोटे, समर्पित मॉडल के साथ on-device tool calling चलाएँ

How Cactus compares

Cactus alongside other open-source local runtimes tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
Ollama★ 189kटर्मिनल से ही open LLMs को अपनी मशीन पर डाउनलोड करें और चलाएं
llama.cpp★ 137kकम मेमोरी के साथ CPU, Apple Silicon और GPU पर C/C++ में LLM चलाएँ
GPT4All★ 77.3kबड़े भाषा मॉडल (LLM) को रोज़मर्रा के लैपटॉप और डेस्कटॉप पर निजी तौर पर चलाएं
Colibrì★ 54.3kएक pure-C inference इंजन, जो Mixture-of-Experts वज़न को डिस्क से स्ट्रीम करता है, ताकि फ़्रंटियर-साइज़ मॉडल आम हार्डवेयर पर चल सकें
LocalAI★ 50.7kसेल्फ़-होस्टेड, OpenAI-compatible API, जो LLM, विज़न, वॉइस और इमेज मॉडल को लोकल रूप से चलाने देता है
Strata★ 50kएक क्लिक वाला लोकल inference engine, जो 12 GB ग्राफ़िक्स कार्ड वाले गेमिंग PC पर 125B Qwen3.8-Flash-Next चलाता है
Jan★ 46.3kअपने कंप्यूटर पर ओपन सोर्स LLM को ऑफ़लाइन चलाएँ, निजी ChatGPT की तरह
Cactus★ 6.2kटेक्स्ट, विज़न और स्पीच मॉडल को फ़ोन, वियरेबल और रोबोट पर चलाने के लिए बना चार-परत वाला इन्फ़रेंस स्टैक — quantizer, kernels, graph और engine