Metadata-Version: 2.4
Name: bananamendr
Version: 1.0.4
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Summary: Local CPU inference for BananaMind-2 chat checkpoints (Rust core, no PyTorch at runtime)
Keywords: llm,inference,safetensors,cpu,rust
Author-email: Adam Twardoch <adam+github@twardoch.com>
License: Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/twardoch/bananamend/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/twardoch/bananamend
Project-URL: Issues, https://github.com/twardoch/bananamend/issues
Project-URL: Repository, https://github.com/twardoch/bananamend.git

# bananamendr (Python)

Local CPU inference for the **BananaMind-2** chat checkpoints — Nano, Mini and
Pro (Preview) — with no PyTorch at runtime. The Rust core reads the published
`model.safetensors` and `tokenizer.json` directly. One abi3 wheel serves every
CPython ≥ 3.9.

Greedy decoding is token-exact against Hugging Face `transformers`.

This module takes **paths only** — it never downloads anything. For checkpoint
fetching, a config file and an OpenAI-compatible server, install
[`bananamendy`](https://pypi.org/project/bananamendy/).

```bash
pip install bananamendr
```

```python
import bananamendr

model = bananamendr.Model("ref/BananaMind-2-Nano-Chat")
print(model.config["model_type"], model.config["num_hidden_layers"])

generation = model.chat(
    [{"role": "user", "content": "Why is the sky blue?"}],
    max_new_tokens=64,
    temperature=0.0,               # greedy; the Python API defaults to greedy
)
print(generation.text, generation.tokens_per_second)

# Streaming: the callback receives (decoded delta, token id) per step.
model.generate("Once upon a time", on_token=lambda text, token: print(text, end=""))
```

Also available: `tokenize`, `detokenize`, `apply_chat_template`, `logits`,
`generate_tokens`.

## License

Apache-2.0

