Skip to main content

Nthuku-Fast

Efficient Multimodal Vision-Language Model with Mixture of Experts (MoE) Architecture

Features

✨ High Performance

  • Flash Attention for 2-4x speedup
  • Extended 8K context window (32x larger)
  • Optimized MoE routing (20-30% faster)

💰 Cost Effective

  • Prompt caching (10x cost reduction)
  • ~8B active parameters (efficient)
  • 90%+ cache hit rates

🧠 Advanced Capabilities

  • Vision understanding
  • Text generation
  • Speculative decoding (2-3x faster)
  • Thinking traces / chain-of-thought

Installation

From PyPI (once published)

pip install nthuku-fast

From source

git clone https://github.com/elijahnzeli1/Nthuku-fast_v2.git
cd Nthuku-fast_v2/nthuku-fast-package
pip install -e .

Local installation (development)

cd nthuku-fast-package
pip install -e .

Quick Start

from nthuku_fast import create_nthuku_fast_model
import torch

# Create model (all optimizations enabled by default)
model = create_nthuku_fast_model(
    hidden_dim=512,
    num_experts=8,
    top_k_experts=2
)

# Or use presets for different sizes
model = create_nthuku_fast_model(preset="150M")  # 150M parameters

# Generate text from image
pixel_values = torch.randn(1, 3, 224, 224)
text = model.generate_text(
    pixel_values,
    max_length=100,
    use_cache=True,      # Enable prompt caching
    show_thinking=False  # Show reasoning traces
)

Model Presets

# 50M parameters (default)
model = create_nthuku_fast_model(preset="50M")

# 150M parameters (recommended)
model = create_nthuku_fast_model(preset="150M")

# 500M parameters (high capacity)
model = create_nthuku_fast_model(preset="500M")

# 1B parameters (maximum)
model = create_nthuku_fast_model(preset="1B")

Advanced Features

Prompt Caching

# Get cache statistics
stats = model.get_cache_stats()
print(f"Cache hit rate: {stats['hit_rate']:.2%}")

Speculative Decoding

from nthuku_fast import SpeculativeDecoder

spec_decoder = SpeculativeDecoder(model, num_speculative_tokens=4)
generated, stats = spec_decoder.generate(
    input_ids, vision_features,
    max_new_tokens=100,
    show_stats=True
)

Thinking Traces

# Enable visible reasoning
text = model.generate_text(
    pixel_values,
    show_thinking=True  # Shows step-by-step reasoning
)

Training

from nthuku_fast import train_nthuku_fast, MultiDatasetManager

# Load datasets
dataset_manager = MultiDatasetManager()
data_sources = dataset_manager.load_all_datasets()

# Train
results = train_nthuku_fast(
    model=model,
    data_sources=data_sources,
    batch_size=8,
    num_epochs=10,
    learning_rate=2e-4
)

Performance

Feature Improvement
Flash Attention 2-4x faster
Extended Context 32x longer (8K tokens)
Optimized MoE 20-30% faster
Prompt Caching 10x cost reduction
Speculative Decoding 2-3x faster generation

Combined: 5-7x faster, 81% cheaper!

Requirements

  • Python ≥ 3.8
  • PyTorch ≥ 2.0.0 (for Flash Attention)
  • transformers ≥ 4.30.0
  • Other dependencies (auto-installed)

License

MIT License

Citation

@software{nthuku_fast,
  title={Nthuku-Fast: Efficient Multimodal Vision-Language Model},
  author={Nthuku Team},
  year={2025},
  url={https://github.com/elijahnzeli1/Nthuku-fast_v2}
}

Metadata

Release files for nthuku-fast 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nthuku-fast 0.1.2
File Size Uploaded
nthuku_fast-0.1.2.tar.gz 39.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nthuku-fast 0.1.2
File Interpreter ABI Platform
nthuku_fast-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 78.5 kB

Release files / nthuku_fast-0.1.2.tar.gz

Download URL nthuku_fast-0.1.2.tar.gz
Size 39.2 kB
Tags Source
SHA-256 checksum
How to use checksums
218d92d1330a76ab323c3eb7610e7c7dd9927481fea617dc1b1ab82cddcc37a6
BLAKE2b-256 checksum
How to use checksums
88e6d362ae3c78e9cecc733df80dae3423dbe8417abfd4f8df143dc6f320d5e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / nthuku_fast-0.1.2-py3-none-any.whl

Download URL nthuku_fast-0.1.2-py3-none-any.whl
Size 39.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd229b1ae28d2e59088570c6015f9553aadf95f257208d14470d497867b0b6a1
BLAKE2b-256 checksum
How to use checksums
7cf0b7613878c36e6102052b98720cba9c8e92d418c4fa824dd087e77215da06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page