Skip to content

RedLordezh7Venom/baremetallama

Repository files navigation

Model used in tests and examples: qwen2.5-0.5b-instruct_q4_K_M.gguf

HuggingFace Repo: provetgrizzner/qwen-bundle

BareMetalLlama 🦙

A universal, OS-agnostic AI model bundler and runner. Build single-file AI executables that run natively on Linux, Windows, and macOS without dependencies, using Cosmopolitan Libc.

🚀 Key Features

  • Polyglot Binaries: One file (.baremetallama) runs on Windows (as .exe), Linux, and macOS.
  • Embedded Inference: The engine and weights are fused into a single executable.
  • Zero Dependencies: No Python, no CUDA, no DLLs required on the target machine.
  • Bare-Metal Vision: Roadmap for .pureblm, a bootable RTOS runner that runs AI directly on hardware.

📂 Project Structure

  • bundler/: CLI tool to package models into .baremetallama files.
  • vendor/llama.cpp/: Modified Llama.cpp source for Cosmopolitan compatibility.
  • Makefile.cosmo: The primary build system for universal binaries.
  • PUREBLM_ARCHITECTURE.md: Technical roadmap for the bare-metal bootable runner.
  • docs/diagrams.md: Mermaid.js diagrams of the system architecture.

🛠️ Build Instructions

1. Requirements

You need the Cosmocc toolchain to compile universal binaries.

# Download and setup Cosmocc
wget https://cosmo.zip/pub/cosmocc/cosmocc.zip
unzip cosmocc.zip -d cosmocc/
export PATH="$PWD/cosmocc/bin:$PATH"

2. Compile the AI Engine

Use the custom Cosmopolitan Makefile to build the portable llama-server.com:

make -f Makefile.cosmo -j$(nproc)

3. Compile the Bundler

cosmoc++ -O3 -mcosmo bundler/bundler.cpp -o bundler/baremetallama.com

4. Create your Universal AI

Pack a GGUF model into a standalone .baremetallama file:

./bundler/baremetallama.com llama-server.com your_model.gguf qwen.baremetallama

🐳 Quick Start with Docker (Recommended)

If you don't want to install cosmocc locally, you can use Docker to bundle your models:

1. Build the Image

docker build -t baremetallama .

2. Bundle a Model

Mount your current directory to /work inside the container:

docker run -v $(pwd):/work baremetallama /work/model.gguf /work/output.baremetallama

This command will output a output.baremetallama file in your local folder that works on any OS.


🖥️ Usage

Windows

Rename to .exe or run directly from CMD/PowerShell:

.\qwen.baremetallama

Linux / macOS

chmod +x qwen.baremetallama
./qwen.baremetallama

By default, running the bundle without arguments launches an interactive Chat TUI in your terminal.


Repository: RedLordezh7Venom/baremetallama
TUI Engine: Modified llama-server (Llama.cpp)
Runtime: Cosmopolitan Libc

About

run AI models anywhere

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors