No description
Find a file
Lilith af92ba0185
Some checks failed
Build and Publish / build-and-publish (push) Failing after 40s
fix(@ml/@tools/model-loader): 🐛 Update package description and deprecated warning
2026-01-04 21:42:35 -08:00
.forgejo/workflows Add CI workflow for build and publish 2025-12-31 19:27:46 -08:00
.githooks
.turbo fix(model-loader): 🛠 update test cases for model format detection 2026-01-04 20:45:36 -08:00
bin feat: universal ML model support with auto-discovery 2026-01-01 15:21:52 -08:00
dist fix(model-loader): 🛠 update test cases for model format detection 2026-01-04 20:45:36 -08:00
node_modules chore: add publishConfig to prevent public npm publishing 2026-01-03 00:42:23 -08:00
scripts chore: add publishConfig to prevent public npm publishing 2026-01-03 00:42:23 -08:00
src chore: add publishConfig to prevent public npm publishing 2026-01-03 00:42:23 -08:00
src_python fix(@ml/@tools/model-loader): 🐛 Update package description and deprecated warning 2026-01-04 21:42:35 -08:00
.gitignore chore: add vitest configuration and test scripts 2026-01-01 16:01:20 -08:00
HANDOFF.md chore: rename package @lilith/model-loader -> @lilith/ml-model-loader 2025-12-31 01:32:00 -08:00
package-lock.json chore: add publishConfig to prevent public npm publishing 2026-01-03 00:42:23 -08:00
package.json chore: bump version to 2.0.3 2026-01-03 00:42:24 -08:00
pyproject.toml chore: rename package @lilith/model-loader -> @lilith/ml-model-loader 2025-12-31 01:32:00 -08:00
README.md chore: rename package @lilith/model-loader -> @lilith/ml-model-loader 2025-12-31 01:32:00 -08:00
tsconfig.json chore: add publishConfig to prevent public npm publishing 2026-01-03 00:42:23 -08:00
vitest.config.ts Add TypeScript test suite (174 tests) 2026-01-01 15:59:59 -08:00

tqftw-model-loader

Unified ML model loading, caching, and device management.

Features

  • GGUF Loader: Load llama-cpp-python models from manifest or direct paths
  • HuggingFace Loader: Load transformers models with automatic device placement
  • Diffusers Loader: Load Stable Diffusion and SDXL pipelines
  • Model Registry: Manifest-based model discovery and caching
  • Device Management: Automatic GPU/CPU selection with memory tracking

Installation

# Core package (no ML frameworks)
pip install -e .

# With GGUF support
pip install -e ".[gguf]"

# With all ML frameworks
pip install -e ".[ml]"

Usage

from tqftw_model_loader.gguf_loader import GGUFModelLoader

loader = GGUFModelLoader()
await loader.load("ministral-3b-instruct")

response = loader.generate("Hello, world!")

Manifest

Models are discovered via ~/.cache/models/manifest.json. The loader supports:

  • Model ID lookup (e.g., "ministral-3b-instruct")
  • Direct file paths (e.g., "/path/to/model.gguf")
  • Remote fetching via rsync