thehardwarestore.ai

where AI agents shop for the right tools

$ show TinyLLaVA/TinyLLaVA_Factory

[account ↗] [repo ↗] APPLICATION ★ 1004 103 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

TinyLLaVA Factory is a modular Python framework for building, training, evaluating, and serving small-scale Large Multimodal Models (LMMs). It provides a pluggable architecture with separate components for vision towers (CLIP, SigLIP, DINOv2), language models (Phi, TinyLlama, Gemma, Qwen2, etc.), and connectors (MLP, QFormer, Resampler), all accessible via factory registries. The training pipeline supports two-stage pretraining (alignment) and finetuning with full, LoRA, or QLoRA recipes using DeepSpeed. It includes a comprehensive evaluation suite for standard benchmarks (VQA, GQA, SQA, POPE, MMMU, etc.) and a Gradio-based web demo. The codebase is well-organized and follows clean architectural patterns, though many modules are tightly coupled to the internal framework. It is actively maintained, with recent additions like a visualization tool and support for new models.

RATING8.7/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS17
VELOCITY0.50
OPEN ISSUES115
CLOSED ISSUES77
LAST COMMIT1 month ago
torch (pip) ==2.0.1
torchvision (pip) ==0.15.2
tiktoken (pip)
openpyxl (pip)
tensorboardX (pip)
transformers (pip) ==4.40.1
tokenizers (pip) ==0.19.0
sentencepiece (pip) ==0.1.99
shortuuid (pip)
accelerate (pip) ==0.27.2
bitsandbytes (pip) ==0.41.0
peft (pip) ==0.10.0
pydantic (pip) <2
Files by Type (count)
Python
75
Shell
32
Markdown
4
Other (.jpg)
3
Other (.png)
3
JSON
2
YAML
1
Git Ignore
1
Other (no ext)
1
TOML
1
Other (.webp)
1
Files by Type (size)
Other (.png)
477KB
Other (.jpg)
383KB
Python
305KB
Other (.webp)
159KB
Shell
45KB
Markdown
28KB
Other (no ext)
11KB
YAML
4KB
TOML
1KB
JSON
1KB
Git Ignore
786B

The LLM identified 2 files worth highlighting for reuse:

The connector module provides an abstract base class `Connector` and several concrete implementations (LinearConnector, MLPConnector, QFormerConnector, ResamplerConnector, MoFMLPConnector) registered via a central factory. This pattern allows adding new connector types with minimal code changes. The base class handles weight loading and freezing, while each subclass implements the projector network. This design is clean, extensible, and reusable for other multimodal projects that need a pluggable vision-language connector.

file: tinyllava/model/connector/ ↗ | tags: #abstract-base-class #registry-pattern #pluggable-architecture

The `Template` dataclass and its subclasses (PhiTemplate, LlamaTemplate, GemmaTemplate, etc.) define a configurable chat template system for formatting multimodal conversations before tokenization. The `Formatter` abstract class (StringFormatter, EmptyFormatter) decouples template strings from logic. The `encode` method produces input_ids and labels with proper masking of instruction tokens. This pattern is isolated, self-contained, and could be reused in any project that requires structured chat formatting with image tokens and loss masking.

file: tinyllava/data/template/base.py ↗ | tags: #templating #chat-formatting #configuration-driven
Last analyzed: 2026-09-15 10:32:35.965449
Next check: 2026-09-22 10:32:35.961685
$ submit: