LocalAI/pkg
Ettore Di Giacinto 8532924a95 feat(gallery/importers): Batch 0 foundation — helpers, sentinel, local detection
Implements the Batch 0 primitives that subsequent importer batches build on:

- pkg/huggingface-api: ModelDetails gains PipelineTag and LibraryName.
  GetModelDetails now layers a best-effort GET /api/models/{repo} fetch
  on top of ListFiles — a metadata outage leaves the fields empty but
  still returns full file details. Uses a dedicated response struct
  because the single-model endpoint uses snake_case keys while the list
  endpoint historically returned camelCase.

- core/gallery/importers/helpers.go: generic HasFile, HasExtension,
  HasONNX, HasONNXConfigPair, HasGGMLFile helpers working on
  []hfapi.ModelFile so per-backend importers can detect artefact
  patterns without duplicating string wrangling.

- core/gallery/importers/importers.go: adds the ErrAmbiguousImport
  sentinel. DiscoverModelConfig now returns it (wrapped with
  fmt.Errorf("%w: ...")) when no importer matched AND the HF
  pipeline_tag falls in a whitelist of narrow modalities (ASR, TTS,
  sentence-similarity, text-classification, object-detection). The
  whitelist is intentionally narrow — unknown tags keep the previous
  "no importer matched" behaviour to avoid blocking rare repos.

- core/gallery/importers/local.go: three new local-path detections,
  inserted before the existing merged-transformers branch:
    * ggml-*.bin → whisper
    * silero*.onnx → silero-vad
    * *.onnx + *.onnx.json pair → piper

- core/http/endpoints/localai/import_model.go: ImportModelURIEndpoint
  surfaces ErrAmbiguousImport as HTTP 400 with
  {error, detail, hint} JSON, preserving existing behaviour for
  unrelated errors.

Green tests:
  go test ./core/gallery/importers/... ./pkg/huggingface-api/... \
          ./core/http/endpoints/localai/...

Assisted-by: Claude:claude-opus-4-7[1m] [Agent]
2026-04-20 21:38:12 +00:00
..
audio feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
concurrency feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
downloader feat(distributed): Avoid resending models to backend nodes (#9193) 2026-03-31 16:28:13 +02:00
functions feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
grpc feat: wire transcription for llama.cpp, add streaming support (#9353) 2026-04-14 16:13:40 +02:00
huggingface-api feat(gallery/importers): Batch 0 foundation — helpers, sentinel, local detection 2026-04-20 21:38:12 +00:00
model feat: wire transcription for llama.cpp, add streaming support (#9353) 2026-04-14 16:13:40 +02:00
oci feat: backend versioning, upgrade detection and auto-upgrade (#9315) 2026-04-11 22:31:15 +02:00
reasoning fix(reasoning): suppress partial tag tokens during autoparser warm-up 2026-04-04 20:45:57 +00:00
sanitize feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
signals feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
sound feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
store chore: fix go.mod module (#2635) 2024-06-23 08:24:36 +00:00
system fix: try to add whisperx and faster-whisper for more variants (#9278) 2026-04-08 21:23:38 +02:00
utils feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
vram feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
xio feat(ui): allow to cancel ops (#7264) 2025-11-13 18:41:47 +01:00
xsync chore: fix go.mod module (#2635) 2024-06-23 08:24:36 +00:00
xsysinfo fix(gpu): better detection for MacOS and Thor (#9263) 2026-04-07 00:39:07 +02:00