@deemwario/mochallama
v0.1.6
Published
Run a local llama.cpp LLM from the terminal — JVM-powered (Project Panama FFM), shipped as self-contained jlink runtime images. Cross-platform via per-platform optional dependencies.
Maintainers
Readme
@deemwario/mochallama
Run a local llama.cpp LLM from your
terminal. The engine is JVM-powered — mochallama-core bridges llama.cpp via
Project Panama (the Foreign Function &
Memory API), no Python and no separate llama.cpp install required.
This npm package is a thin cross-platform launcher. The actual payload — a
self-contained jlink runtime image (a trimmed JRE plus the native llama.cpp
libraries) — ships in a per-platform companion package that npm installs
automatically for your OS/CPU. You do not need a JDK installed to use it.
Platform support
Installs and runs on:
| platform | companion package |
|------------------------|---------------------------------------|
| macOS Intel (x64) | @deemwario/mochallama-darwin-x64 |
| macOS Apple Silicon | @deemwario/mochallama-darwin-arm64 |
| Linux (x64) | @deemwario/mochallama-linux-x64 |
| Windows (x64) | @deemwario/mochallama-win32-x64 |
npm pulls in only the companion matching your host (via each companion's
os/cpu fields); the others are skipped. The launcher resolves the right one
at runtime.
Install / run
# One-shot via npx — drops straight into a chat session.
npx @deemwario/mochallama
# Or install globally.
npm i -g @deemwario/mochallamaUsage
# Bare invocation starts chatting immediately (defaults to `chat`).
mochallama
# List available model profiles and whether they're cached locally.
mochallama models
# Chat with a specific model (downloads it on first use into ~/.chatbot_models).
mochallama chat --model llama-3.2-1b
# Help.
mochallama --helpHow it works
mochallama (this npm bin)
└─ bin/mochallama.js # cross-platform launcher
└─ @deemwario/mochallama-<platform> # resolved via os/cpu
└─ image/bin/mochallama # jlink launcher (trimmed JRE + JVM args)
└─ mochallama-core # Panama FFM bridge → llama.cpp nativesThe jlink launcher runs with --enable-native-access=ALL-UNNAMED and
--add-modules=jdk.incubator.vector baked in. A bare invocation with no
arguments forwards chat so you start talking to a model right away.
Building / publishing (maintainers)
The companion packages' image/ directories are not committed — they're
produced by Gradle (:cli:jlink) and copied in before publishing. Locally
(macOS x64), from the repo root:
task cli:npm:pack # builds the jlink image, stages it into the darwin-x64
# companion + the main package, then `npm pack` bothAll four platforms' images are produced by the GitHub Actions release matrix on
a v* tag — see .github/workflows/release.yml.
License
MIT
