NeuralAI-Mamba-K1 / README.md
Subject-Emu-5259's picture
Upload README.md with huggingface_hub
4562320 verified
|
Raw
History Blame Contribute Delete
9.88 kB
metadata
license: apache-2.0
language:
  - en
tags:
  - neuralai
  - mamba
  - ssm
  - state-space-model
  - causal-lm
  - mambapy
  - fine-tuned
  - text-generation
  - local-ai
  - assistant
pipeline_tag: text-generation
base_model: state-spaces/mamba-130m-hf
NeuralAI Mamba K1 banner

🧬 NeuralAI β€” Mamba K1

NeuralAI's first owned base model.
A Mamba state-space language model fine-tuned for assistant-style chat, reasoning, code, and safe conversation.

Mamba K1 SmolLM2 360M GitHub


πŸš€ Quick facts

Property Value
Architecture Mamba SSM β€” model_type: mamba
Class MambaForCausalLM
Parameters ~130M (hidden size 768, 24 layers)
State size 16
Vocabulary 50,280
Base model state-spaces/mamba-130m-hf
Fine-tune method LoRA SFT, vocabulary-safe chat format
LoRA config rank 16, alpha 32 (iterative v2/v3)
Dataset NeuralAI seed set β€” assistant conversations spanning reasoning, code, math, writing, safety, and creative prompts
Training runtime CPU/GPU SFT loops; iterative GGUF merge + quantization
Formats in this repo Merged safetensors Β· Q4_K_M GGUF Β· F16 GGUF
Status πŸ”¬ R&D / chat-format repair for future release
License Apache 2.0

🧬 What is Mamba K1?

Mamba K1 is the first model NeuralAI owns end-to-end. Unlike adapters on a third-party transformer, this model starts from a base Mamba SSM architecture and is trained, merged, and quantized into a self-contained artifact.

Mamba SSMs replace quadratic self-attention with a linear, state-space recurrence. That makes them fast at long context and cheap to serve β€” ideal for a local-first assistant that runs on modest hardware.

Architecture highlights

  • Linear complexity β€” (O(n)) sequence scaling instead of (O(n^2)) attention
  • Long context friendly β€” state dimension is small and recurrent; context length grows efficiently
  • Pure-Python reference kernels β€” uses mambapy so the model loads without custom CUDA
  • Reasonable footprint β€” 130M params fits on CPU, edge devices, and budget GPUs

NeuralAI model family

NeuralAI two-model architecture
Model Architecture Parameters Role Status
🧬 Mamba K1 Mamba SSM 130M NeuralAI's first owned base πŸ”¬ R&D
🧠 NeuralAI Powered by SmolLM2‑360M Transformer + LoRA 360M Live chat backend ⚑ Active

🧠 What K1 learned in training

The SFT curriculum taught the model to behave like an assistant across a deliberately small but diverse seed set:

  • Reasoning β€” step-by-step breakdowns of classic puzzles, logic traps, and estimations
  • Code β€” Python/JS/Go/Rust/SQL patterns plus debugging and refactoring guidance
  • Math β€” algebra, combinatorics, probability
  • Writing β€” drafts, haiku, product announcements, tone matching
  • Safety β€” refusals and redirection for harmful requests, crisis resources, and age-inappropriate prompts
  • NeuralAI identity β€” anchoring to the NeuralAI project, its creator, and local-first mission

⚠️ Scale note: 130M parameters is a research-capability checkpoint, not yet frontier-grade. K1 is the starting point for a fully owned NeuralAI model lineage.


πŸ‹οΈ Training summary

Mamba K1 training highlights

Phase Detail
Data Curated assistant seed set (reasoning, code, math, writing, safety, creative)
Objective SFT on assistant-style completions
Method LoRA SFT β†’ merge β†’ GGUF quantization
Chat format NeuralAI "intel" format β€” uses only tokens present in the GPT-NeoX tokenizer (`<
Final train loss (checkpoint) 11.69 (down from ~13.5)
Output formats Merged safetensors, Q4_K_M GGUF, F16 GGUF

Full training logs, merge scripts, and the iteration runbook live in the main NeuralAI repository.


πŸ› οΈ Usage

Load from Hugging Face β€” merged weights

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "Subject-Emu-5259/NeuralAI-Mamba-K1",
    torch_dtype=torch.float32,
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
    "Subject-Emu-5259/NeuralAI-Mamba-K1",
    trust_remote_code=True,
)

messages = [{"role": "user", "content": "Write a haiku about debugging."}]
inputs = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_tensors="pt",
)
out = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))

Serve locally with llama.cpp

Use the Q4_K_M or F16 GGUF in this repo:

./llama-server \
  --model neuralai-mamba-k1-v3.Q4_K_M.gguf \
  --chat-format neuralai-intel \
  --port 1234

The NeuralAI model manager can point a local llama.cpp backend at this GGUF when K1 becomes the active inference target.


🧰 What Is NeuralAI?

NeuralAI is a local-first, private generative AI engine built by De'Andrew Preston Harris. It is the central intelligence layer of an ecosystem that includes:

  • NeuralAI Web UI β€” chat, live terminal, file IDE, slash tools, and settings in one workspace
  • NeuralLabs β€” a standalone downloadable intelligence environment
  • NeuralDrive β€” private cloud storage and versioning
  • Agentic Orchestrator β€” goal-driven manager/worker execution

The mission is simple: your AI, on your hardware, under your control.


πŸ‘€ Who Created NeuralAI?

  • Founder & Lead Architect: De'Andrew Preston Harris (D. Harris / Dre)
  • GitHub: @Subject-Emu-5259
  • LinkedIn: linkedin.com/in/deandrewharris94
  • Location: Memphis, Tennessee / West Memphis, Arkansas
  • Education: AI Software Engineering at Maestro College

NeuralAI was built from resilience, fatherhood, and the belief that personal computing deserves personal intelligence. Every release is handcrafted, iterated, and documented in the open.


🏒 About NeuralAI (The Project)

Project / Brand NeuralAI
Motto Your AI. On your hardware. In your browser.
Values Privacy, ownership, local-first computing, disciplined iteration, open weights
Primary Repository github.com/Subject-Emu-5259/NeuralAI
Model Collection huggingface.co/Subject-Emu-5259
License Apache 2.0

NeuralAI is not a closed SaaS product. It is a living open-weights research project becoming a sustainable AI software company built by one determined builder and the community around him.


⚠️ Limitations

  • Scale: 130M parameters is early-stage; long-form reasoning, coding, and deep recall are limited.
  • Chat format sensitivity: Use the NeuralAI "intel" format; other templates may produce token soup because the tokenizer lacks common chat special tokens.
  • Training maturity: Chat coherence training is ongoing; expect looping, echoing, or drift on longer contexts.
  • No internet: The model has no live web access unless paired with NeuralAI's tool layer.

πŸ“Š NeuralAI Powered by SmolLM2 β€” the active chat model

Right now NeuralAI's live chat backend is the awareness-tuned SmolLM2-360M model. While K1 matures, that model handles everyday assistant tasks:

NeuralAI model comparison


πŸ“š Related Resources


πŸ“– Citation

@software{neuralai_mamba_k1_2026,
  author       = {Harris, De'Andrew Preston},
  title        = {NeuralAI β€” Mamba K1},
  year         = {2026},
  url          = {https://huggingface.co/Subject-Emu-5259/NeuralAI-Mamba-K1},
  version      = {v3},
  description  = {NeuralAI's first owned Mamba SSM base model (130M) for local-first AI research}
}

Built with discipline by De'Andrew Preston Harris. Maintained in the open. Updated whenever the model, dataset, or project state changes.