feat: Add GGUF/llama-cpp backend to terraphim LLM proxy layer

Offen
#538 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
28/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
rust
Bereich
ai

Rechercherichtung

Start by comparing the existing remote genai client trait with the proposed new crates/terraphim_llm_local/ or feature in terraphim_multi_agent, then review the approved llama-cpp-rs and hf-hub dependencies. Done means CPU-only GGUF inference, automatic model download, quantization selection, and transparent compatibility with the existing client trait.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement multi-agent

Problem

terraphim-ai has no local inference capability. All LLM calls go through remote APIs (OpenRouter via genai). For machines without GPU or API access, there is no fallback. GGUF models for MedGemma are available (unsloth/medgemma-1.5-4b-it-GGUF, 11.8K downloads on HuggingFace).

Proposed Change

Add a terraphim_llm_local crate (or feature in terraphim_multi_agent) that wraps llama-cpp-rs for local GGUF inference. Implement the same LLM client trait so agents can transparently use local or remote models.

Key requirements:

  • CPU-only inference support (many dev machines lack GPU)
  • Automatic GGUF model download via hf-hub crate
  • Quantization variant selection (Q4_K_M ~2.5GB for 4B models, Q8_0 for higher quality)
  • Same trait interface as the remote genai client for seamless swapping

Scope

  • New crate crates/terraphim_llm_local/ or feature gate in terraphim_multi_agent
  • Dependencies: llama-cpp-rs, hf-hub (both approved)

Context

This is UPLIFT-5 from the medgemma-competition multi-agent integration plan. Local GGUF inference is essential for development workflows where remote API calls are slow or unavailable. The MedGemma 1.5-4b-it GGUF model is the primary target for local inference.

Related upstream issues: #534, #535, #536

Vorherrschende Sprache
Rust
Sterne
62
Forks
5
Ø Merge
2 Std. 27 Min.
Gemergte PRs (30 T.)
1

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus terraphim/terraphim-ai

Alle Issues in terraphim/terraphim-ai

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.