How drumih/turbo-fieldfare works
TurboFieldfare is a Swift/Metal Gemma 4 inference suite: a native Mac app, CLI, loopback OpenAI-compatible server, decode service, runtime library, and streaming installer. The main workflow is to install and verify a .gturbo model, load it, submit a prompt, and stream generated output; an optional companion vision pack enables image prompts. The graph preserves those products and the runtime’s model, generation, and vision responsibilities. Relationships are limited to README statements and source-index references; unsampled implementation details are not inferred.
Main entry points: Model.swift Model Loader · RealForwardRunner.swift Forward Runner · RootView.swift Mac App · RemoteStreamingRepacker.swift Remote Streaming
Components 22
User Interfaces
- Mac App
Sources/TurboFieldfareApp/Mac/App/RootView.swift - App Inference Client
Sources/TurboFieldfareApp/Core/Inference/DecodeServiceInferenceClient.swift - CLI Chat
Sources/TurboFieldfareCLI/Run.swift - OpenAI Server
Sources/TurboFieldfareServer/Core/ServerInference.swift
Model Installation
- Repack Installer
Sources/TurboFieldfareRepack/Command/main.swift - Remote Streaming
Sources/TurboFieldfareRepack/Core/Remote/RemoteStreamingRepacker.swift - Install Verification
Sources/TurboFieldfareRepack/Core/Verification/VerifiedInstallTool.swift
Inference Runtime
- Decode Service
Sources/TurboFieldfareDecodeService/Entry.swift - Forward Runner
Sources/TurboFieldfare/Runtime/Inference/RealForwardRunner.swift - Generation
Sources/TurboFieldfare/Runtime/Generation/Generator.swift - Tokenization
Sources/TurboFieldfare/Tokenization/Tokenizer.swift - Metal Kernels
Sources/TurboFieldfare/Kernels - KV Cache
Sources/TurboFieldfare/Runtime/KVCache/KVCacheManager.swift
Model Data
- Model Loader
Sources/TurboFieldfare/Runtime/Inference/Model.swift - Expert Streaming
Sources/TurboFieldfare/Runtime/Inference/ModelExpertIO.swift
Vision Support
- Vision Pack
Sources/TurboFieldfareRepack/Core/Remote/RemoteVisionPackInstaller.swift - Image Preprocessing
Sources/TurboFieldfare/Runtime/Vision/Preprocessing/Gemma4ImagePreprocessor.swift - Vision Runtime
Sources/TurboFieldfare/Runtime/Vision/VisionRuntime.swift - Multimodal Prefill
Sources/TurboFieldfare/Runtime/Vision/MultimodalPrefillInput.swift
Other components
- User
- Hugging Face
- Local SSD
Connections 23
- User → Mac App: prompts
README.md - User → CLI Chat: prompts
README.md - User → OpenAI Server: sends requests
README.md - Mac App → App Inference Client: generates through
- App Inference Client → Decode Service: launches and requests
- CLI Chat → Model Loader: loads for inference
Sources/TurboFieldfareCLI/Run.swift - OpenAI Server → Model Loader: loads for inference
Sources/TurboFieldfareServer/Core/ServerInference.swift - Decode Service → Model Loader: owns model runtime
- Repack Installer → Remote Streaming: runs installation
Sources/TurboFieldfareRepack/Command/main.swift - Remote Streaming → Hugging Face: streams ranges
README.md - Remote Streaming → Local SSD: writes model
README.md - Repack Installer → Install Verification: verifies installation
Sources/TurboFieldfareRepack/Command/main.swift - Mac App → Repack Installer: offers installation
README.md - Model Loader → Local SSD: reads model files
- Forward Runner → Model Loader: uses loaded model
Sources/TurboFieldfare/Runtime/Inference/RealForwardRunner.swift - Forward Runner → Expert Streaming: streams experts
- Forward Runner → Metal Kernels: dispatches compute
Sources/TurboFieldfare/Runtime/Inference/RealForwardRunner.swift - Generation → Tokenization: uses tokenization
- Generation → KV Cache: maintains context
- Vision Pack → Local SSD: installs companion pack
README.md - Image Preprocessing → Multimodal Prefill: prepares image input
- Vision Runtime → Multimodal Prefill: provides image features
- Multimodal Prefill → Forward Runner: supplies prefill input
Sources/TurboFieldfare/Runtime/Inference/RealForwardRunner.swift