
एक एम्बेड करने योग्य, पोर्टेबल, ब्रांच करने योग्य वर्चुअल मशीन जो Agents को स्थानीय रूप से सुरक्षित रूप से चलाने के लिए है।
<p align="center">
<img src="https://assets.kitploit.com/production/public/readmes/7141/6b8fd173bd97d64ea831a59cdc2b4fd2392dc9b5f2cc90c91594cdb4925a9949.png" alt="smol machines" width="80">
</p>
<p align="center">
<a href="https://discord.gg/E5r8rEWY9J"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
<a href="https://github.com/smol-machines/smolvm/releases"><img src="https://img.shields.io/github/v/release/smol-machines/smolvm?label=Release" alt="Release"></a>
<a href="https://github.com/smol-machines/smolvm/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"></a>
<a href="https://www.npmjs.com/package/smolmachines"><img src="https://img.shields.io/npm/v/smolmachines?label=npm&logo=npm" alt="npm"></a>
<a href="https://pypi.org/project/smolmachines/"><img src="https://img.shields.io/pypi/v/smolmachines?label=PyPI&logo=pypi&logoColor=white" alt="PyPI"></a>
<a href="https://crates.io/crates/smolmachines"><img src="https://img.shields.io/crates/v/smolmachines?label=crates.io&logo=rust" alt="crates.io"></a>
</p>
smolvm
======
**AI एजेंट्स के लिए ब्रांच करने योग्य microVM।**
हल्के वर्चुअल मशीनों को अपने सॉफ़्टवेयर, पोर्टेबल डेव एनवायरनमेंट और स्थानीय सैंडबॉक्सिंग में एम्बेड करें।
इंस्टॉल करें
-------
```bash
brew install smol-machines/tap/smolvm # macOS (Homebrew)
curl -sSL https://smolmachines.com/install.sh | bash # macOS + Linux
```
Windows: `windows-x86_64` [release](https://github.com/smol-machines/smolvm/releases) को unzip करें और `smolvm.exe` चलाएँ ([Windows Hypervisor Platform](https://learn.microsoft.com/en-us/virtualization/api/) की आवश्यकता है)। Coding agents: इंस्टॉल करने के बाद हर कमांड जानने के लिए `smolvm --help` चलाएँ।
मनुष्यों और agents के लिए दस्तावेज़ [`docs/`](https://github.com/smol-machines/smolvm/blob/main/docs/README.md) में हैं, प्रत्येक कार्य के लिए एक फ़ोल्डर: तथ्यों के साथ एक `README.md` और एक `SKILL.md` जिसका agent अनुसरण कर सकता है, उसके scripts के साथ, प्रत्येक सुविधा के संदर्भ पृष्ठ के बगल में।
Quick Start
-----------
```bash
smolvm machine run --net --image alpine -- uname -a # one-off VM, removed on exit
smolvm machine run --net -it --image alpine -- /bin/sh # interactive shell
```
लोकल
-----
अपने लैपटॉप या अपने सर्वर पर मुफ़्त, अपने स्वयं के कर्नेल वाले असली VM। ये एक सेकंड से भी कम समय में बूट होते हैं, और मेमोरी लोचदार होती है, इसलिए होस्ट केवल उतनी ही मेमोरी आवंटित करता है जितनी गेस्ट उपयोग करता है। मशीनें रीस्टार्ट के बाद भी बनी रहती हैं, और कोई भी OCI इमेज काम करती है, जिनमें आपके द्वारा लोकल रूप से बनाई गई इमेजें भी शामिल हैं।
```bash
smolvm machine create --net --name dev && smolvm machine start --name dev
smolvm machine exec --name dev -- apk add git
docker save myapp | smolvm machine run --image - -- ./app # local image, no registry
```
एक [Smolfile](https://github.com/smol-machines/smolvm/blob/main/docs/smolfile.md) में मशीन घोषित करें: इमेज, संसाधन, पोर्ट, माउंट और नेटवर्क नीति एक ही चेक-इन की गई फ़ाइल में।
एम्बेड करने योग्य
----------
एक ही `Machine` API से अपने स्वयं के कोड से मशीनों को चलाएँ। SDKs आपकी प्रक्रिया में बिना किसी डेमॉन के चलते हैं, स्थानीय रूप से या [smol cloud](https://smolmachines.com) पर।
```bash
npm install smolmachines # Node / TypeScript
pip install smolmachines # Python
cargo add smolmachines # Rust
```
```ts
import { Machine } from 'smolmachines';
const m = await Machine.create({ image: 'python:3.12-alpine', network: true });
const r = await m.exec(['python3', '-c', 'print(2 ** 10)']);
console.log(r.stdout); // 1024
await m.delete();
```
स्रोत और दस्तावेज़: [smol-machines/smol](https://github.com/smol-machines/smol) · [smolmachines.com/docs/sdk](https://smolmachines.com/docs/sdk)
Branchable
----------
एक चल रही मशीन को निष्पादन के बीच में सहेजें, उसे रिवाइंड करें, या उसकी प्रतियाँ बनाएँ जो उसी बिंदु से चलती रहें। चेकपॉइंट RAM, CPU स्थिति और डिस्क को कैप्चर करते हैं; ब्रांच एक लाइव मशीन के copy-on-write चाइल्ड होते हैं।
```bash
smolvm machine create --net --name agent --image alpine
smolvm machine start --name agent --branchable
smolvm machine branch --from agent --name try-1 # live copy-on-write child
smolvm machine checkpoint --name agent -o agent.checkpoint # save it, processes and all
smolvm machine create --name agent2 --from agent.checkpoint # resume later or elsewhere
```
`--from <checkpoint> --at '~N'` के साथ किसी पुराने जनरेशन पर रिवाइंड करें (देखें `machine checkpoint-log`), और [pause and resume](https://github.com/smol-machines/smolvm/blob/main/docs/pause-resume.md) के साथ निष्पादन खोए बिना रोकें। arm64 Mac पर लिया गया चेकपॉइंट arm64 Linux पर फिर से शुरू होता है, देखें [Moving a running machine from a Mac to Linux](https://github.com/smol-machines/smolvm/blob/main/docs/mac-to-linux.md)। अधिक जानकारी [Branching](https://github.com/smol-machines/smolvm/blob/main/docs/branching.md) और [incremental checkpoints](https://github.com/smol-machines/smolvm/blob/main/docs/incremental-checkpoints.md) में।
पोर्टेबल
--------
किसी मशीन को, चाहे आप इसे कैसे भी सेट करें, एक ही `.smolmachine` फ़ाइल में पैक करें। इसे किसी भी OCI रजिस्ट्री पर पुश करें, या इसे एक स्व-निहित निष्पादन योग्य के रूप में चलाएँ जो बिना कुछ इंस्टॉल किए 200 ms से कम में बूट हो जाता है।
```bash
smolvm machine stop --name dev && smolvm pack create --from-vm dev -o dev
smolvm pack push --file dev.smolmachine ghcr.io/you/dev:v1
smolvm pack create --image python:3.12-alpine -o ./python312
./python312 run -- python3 --version
```
चेकपॉइंट्स भी पोर्टेबल हैं: किसी एक को दूसरे होस्ट पर या smol क्लाउड पर रिस्टोर करें।
सुरक्षित
----
प्रत्येक वर्कलोड को अपने कर्नेल वाला हार्डवेयर-आइसोलेटेड VM मिलता है। नेटवर्किंग डिफ़ॉल्ट रूप से बंद रहती है, ईग्रेस को नामित होस्ट्स तक सीमित किया जा सकता है, और कोड किसी क्रेडेंशियल का उपयोग किए बिना उसे पढ़े ही नहीं सकता।
सुरक्षा एक साझा ज़िम्मेदारी है। smolvm सीमा प्रदान करता है: प्रत्येक वर्कलोड के लिए एक अलग VM और कर्नेल, जिसमें कुछ भी होस्ट तक नहीं पहुँचता जब तक आप अनुमति न दें। वह सीमा क्या पार करेगा, यह आप तय करते हैं। आपके द्वारा माउंट किया गया प्रत्येक फ़ोल्डर, खोला गया पोर्ट, अनुमत किया गया होस्ट, और फ़ॉरवर्ड किया गया सीक्रेट या SSH एजेंट वह चीज़ बन जाता है जिसका उपयोग वर्कलोड कर सकता है, इसलिए किसी अविश्वसनीय वर्कलोड को केवल वही दें जिसकी उसे आवश्यकता है।
```bash
smolvm machine run --net --image alpine --allow-host registry.npmjs.org -- wget -qO- https://google.com # blocked
smolvm machine run --net --image alpine --allow-host-pattern registry.npmjs.org -- wget -qO- https://registry.npmjs.org # exact host only
NOTION_API_KEY=secret_… smolvm machine run --net --image alpine \
--credential [email protected] -- sh -c 'echo $NOTION_API_KEY' # a placeholder
```
[credential substitution](https://github.com/smol-machines/smolvm/blob/main/docs/credential-substitution.md) और [security model](https://github.com/smol-machines/smolvm/blob/main/docs/security-model.md) देखें।
केवल सबडोमेन की अनुमति देने के लिए `--allow-host-pattern '*.example.com'` का उपयोग करें; `--allow-host example.com` एपेक्स और
उसके सबडोमेन की अनुमति देता है। `smolvm machine update` प्रविष्टियाँ जोड़ता है (`--allow-host`, `--allow-host-pattern`, `--allow-cidr`) और हटाता है
(`--remove-allow-host`, कोई होस्ट या पैटर्न जैसे उसे जोड़ा गया था; `--remove-allow-cidr`), एक चल रही मशीन पर भी
जिसे अनुमति सूची के साथ शुरू किया गया था: एक अनुदान अगले कनेक्शन या लुकअप पर लागू होता है, और हटाए गए होस्ट के सीखे गए पते उसके साथ चले जाते हैं।
यह कैसे काम करता है
------------
प्रत्येक वर्कलोड [Hypervisor.framework](https://developer.apple.com/documentation/hypervisor) (macOS), KVM (Linux), या [Windows Hypervisor Platform](https://learn.microsoft.com/en-us/virtualization/api/) (Windows) पर अपने स्वयं के गेस्ट कर्नेल के साथ हार्डवेयर-वर्चुअलाइज़्ड VM में चलता है। [libkrun](https://github.com/containers/libkrun) VMM है और [libkrunfw](https://github.com/smol-machines/libkrunfw) गेस्ट कर्नेल प्रदान करता है। इमेजें [OCI](https://opencontainers.org/) प्रारूप का उपयोग करती हैं, इसलिए Docker Hub, ghcr.io या किसी अन्य रजिस्ट्री पर मौजूद कोई भी चीज़ बिना किसी Docker डेमॉन के माइक्रोVM के रूप में बूट होती है।
डिफ़ॉल्ट: 4 vCPU, 8 GiB RAM। मेमोरी virtio balloon के माध्यम से लोचदार है और निष्क्रिय vCPU हाइपरवाइज़र में सो जाते हैं, इसलिए ओवर-प्रोविज़निंग पर लगभग कुछ भी खर्च नहीं होता। `--cpus` और `--mem` से ओवरराइड करें।
तुलना
----------
| | smolvm | कंटेनर | Colima | QEMU | Firecracker | Kata |
|---------------------|--------|------------|--------|------|-------------|------|
| वर्कलोड सीमा | VM + गेस्ट कर्नेल | नेमस्पेस + साझा कर्नेल | साझा VM के अंदर नेमस्पेस | VM + गेस्ट कर्नेल | VM + गेस्ट कर्नेल | प्रति कंटेनर VM |
| बूट समय | एजेंट तैयार होने तक <200ms | ~100ms | ~सेकंड | ~15-30s | <125ms | ~500ms |
| आर्किटेक्चर | लाइब्रेरी (libkrun) | डेमॉन | डेमॉन (VM में) | प्रोसेस | प्रोसेस | रनटाइम स्टैक |
| प्रति-वर्कलोड VM | हाँ | नहीं | नहीं (साझा) | हाँ | हाँ | हाँ |
| macOS नेटिव | हाँ | Docker VM के माध्यम से | हाँ (krunkit) | हाँ | नहीं | नहीं |
| एम्बेडेबल SDK | हाँ | नहीं | नहीं | नहीं | नहीं | नहीं |
| पोर्टेबल आर्टिफैक्ट्स | `.smolmachine` | इमेजें (डेमॉन चाहिए) | नहीं | नहीं | नहीं | नहीं |
प्लेटफ़ॉर्म समर्थन
----------------
| होस्ट | गेस्ट | आवश्यकताएँ |
|------|-------|-------------|
| macOS Apple Silicon | arm64 Linux | macOS 11+ |
| macOS Intel | x86_64 Linux | कोई रिलीज़ बिल्ड प्रकाशित नहीं; अप्रयुक्त |
| Linux x86_64 | x86_64 Linux | KVM (`/dev/kvm`) |
| Linux aarch64 | aarch64 Linux | KVM (`/dev/kvm`) |
| Windows x86_64 | x86_64 Linux | Windows Hypervisor Platform (WHP) सक्षम |
Windows पोर्टेबल चेकपॉइंट, pause/resume, और `--freeze-source` के साथ ब्रांच का समर्थन करता है। GPU त्वरण अभी भी अनुपलब्ध है; [known limitations](https://github.com/smol-machines/smolvm/blob/main/docs/limitations.md) देखें।
अधिक
----
* [Kubernetes](https://github.com/smol-machines/smolvm/blob/main/docs/kubernetes.md): `RuntimeClass` के माध्यम से पॉड्स को माइक्रोVM के रूप में चलाएँ।
* [GPU and CUDA](https://github.com/smol-machines/smolvm/blob/main/docs/gpu.md): virtio-gpu / Venus के माध्यम से Vulkan, और CUDA API रिमोटिंग।
* [Examples](https://github.com/smol-machines/smolvm/blob/main/examples): python, node, docker-in-vm, local-llm, headless-browser, doom।
* [Development](https://github.com/smol-machines/smolvm/blob/main/docs/DEVELOPMENT.md) · उपयोगकर्ता दस्तावेज़ [smolmachines.com/docs](https://smolmachines.com/docs/) पर, [smol-machines/docs](https://github.com/smol-machines/docs) में लिखे गए (सुधार वहाँ स्वागत योग्य हैं; रनटाइम बग यहीं रहते हैं)।
smolvm [smol machines](https://smolmachines.com) के पीछे का ओपन-सोर्स रनटाइम है, और SmolVM नाम के अन्य प्रोजेक्ट्स से संबद्ध नहीं है।
[Apache-2.0](https://github.com/smol-machines/smolvm/blob/main/LICENSE) · [@binsquare](https://github.com/BinSquare) द्वारा निर्मित · [twitter](https://x.com/binsquares) · [github](https://github.com/smol-machines/smolvm)