Metadata-Version: 2.4
Name: imurun
Version: 0.3.4
Summary: Local-first AI chat with its own C++ inference engine (FISH): one process, no cloud
Author-email: ImuTechz <dev@imutechz.in>
License-Expression: MIT
Project-URL: Homepage, https://github.com/shubham001312/imurun
Project-URL: Source, https://github.com/shubham001312/imurun
Project-URL: Issues, https://github.com/shubham001312/imurun/issues
Project-URL: Releases, https://github.com/shubham001312/imurun/releases
Keywords: llm,local-ai,gguf,chat,inference,offline
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9
Requires-Dist: httpx>=0.27
Requires-Dist: huggingface_hub>=0.23
Requires-Dist: pyyaml>=6.0
Requires-Dist: truststore>=0.9
Provides-Extra: window
Requires-Dist: pywebview>=5.0; extra == "window"
Provides-Extra: connectors
Requires-Dist: keyring>=24.0; extra == "connectors"
Provides-Extra: metrics
Requires-Dist: psutil>=5.9; extra == "metrics"
Provides-Extra: api
Requires-Dist: fastapi>=0.110; extra == "api"
Requires-Dist: pydantic>=2.5; extra == "api"
Provides-Extra: voice
Requires-Dist: faster-whisper>=1.1; extra == "voice"
Requires-Dist: av>=12; extra == "voice"
Requires-Dist: piper-tts>=1.3; extra == "voice"
Requires-Dist: numpy>=1.24; extra == "voice"
Provides-Extra: all
Requires-Dist: imurun[api,connectors,metrics,window]; extra == "all"
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
Requires-Dist: pytest-cov>=5.0; extra == "test"
Requires-Dist: pytest-xdist>=3.5; extra == "test"
Provides-Extra: dev
Requires-Dist: imurun[test]; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# IMURUN

Local-first AI chat with its own inference engine. One process, no cloud: a C++
engine (**FISH**) runs GGUF models on the CPU, a Python server hosts sessions,
tools and connectors, and a vanilla-JS "Liquid Paper" UI opens in a native
window or your browser. Windows, macOS and Linux.

## Install

Needs Python 3.11–3.14 (3.12 recommended).

```
pip install imurun            # then:  imurun
npx imurun                    # or:    npm i -g imurun && imurun
```

- **pip** installs the `imurun` command. Wheels for Windows x64, Linux x64
  (glibc 2.28+) and macOS arm64 include the FISH engine; on other platforms
  pip installs the app without it, and `imurun --get-engine` or a source build
  supplies it. `pip install "imurun[window]"` adds the native window.
- **npm** is a thin launcher with no dependencies: it finds Python, creates
  `~/.imurun/venv`, installs the matching `imurun` version from PyPI there,
  and runs it. If Python is missing it tells you how to install it.
- Everything IMURUN writes (sessions, models, logs, settings) goes to
  `~/.imurun` (override with `IMURUN_DATA_ROOT`).

Flags: `--window` (native window via pywebview, default when installed),
`--browser`, `--no-open`, `--port N`, `--model path.gguf`, `--version`,
`--get-engine`.

### From source

```
# Windows            macOS                 Linux
run.bat              ./run.command         ./run.sh
```
Each script creates `.venv`, installs `requirements.txt`, and starts the server
(`python start.py`, which takes the same flags as `imurun`).
Full setup and troubleshooting: `docs/setup/README.md`. Releasing:
`docs/setup/RELEASE.md`.

Models are downloaded from the **Models** tab (Llama 3.x, Mistral, Qwen 2.5/3,
Phi-3, Gemma 2, DeepSeek-R1 distills, Mixtral…) or placed in `models/`.

## Engine in one paragraph

FISH memory-maps a GGUF, keeps weights quantised, quantises activations to int8
once per matmul and runs AVX2 integer dot products (scalar fallback elsewhere).
Chat templates are applied structurally inside the engine (user text can never
inject control tokens), a KV prefix cache makes repeated system prompts free, and
when a model is larger than free RAM the next layer's pages are prefetched while
the current one computes. Supported architectures: llama (incl. Mistral,
DeepSeek distills, Mixtral MoE), qwen2/qwen3 (+MoE), qwen35 (Qwen3.5 hybrid DeltaNet), phi3,
gemma2. Details, limits
and numbers: `docs/engine/`.

GPU: a Vulkan backend runs whole layers in VRAM where they fit (tested on NVIDIA only;
`docs/engine/GPU.md`). What it is **not** (yet): a GPU engine on macOS (no Metal; the Mac
build is CPU-only), or a VRAM/NVMe tiered streamer — see `docs/ROADMAP.md`.

## Build the engine

```
cd model/fish
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release   # GCC/Clang; MSVC not supported
ninja -C build
./build/fish_test_m1 ../../models/<model>.gguf
./build/fish_test_m2 ../../models/<model>.gguf
```
Copy `build/fish.dll` (`libfish.so`, `libfish.dylib`) to `bin/`.

## Layout

```
imurun/                          the `imurun` command (pip); setup.py bundles the app into it
npm/imurun.js, package.json      the npm launcher
start.py, install.py, run.*      launchers and installer
model/fish/                      FISH engine (C++), tests in model/fish/test
model/*.py                       ctypes bindings and model client
services/                        server, turns, sessions, tools, connectors, safety
frontend/design-lab/             UI (no build step)
docs/                            documentation index: docs/README.md
tests/                           runnable engine/server scripts
archive/                         retired one-off scripts
```

Working on it? Read `CLAUDE.md` (applies to humans and CLI agents alike).

## Security

Loopback-only bind, per-run bearer token injected into the page (never in URLs
or logs), 1 MB body cap, Host-header check, strict CSP (`default-src 'self'`),
OAuth tokens in the OS keychain, approval cards for write actions.

MIT License — see `LICENSE`.
