Switch-Alpaka 让已运行 homebrew 的 Nintendo Switch 能完全离线运行本地 GGUF 大语言模型,基于 llama.cpp,提供纯 CPU 推理、控制台界面、模型选择器和保存到 SD 卡的多聊天历史。

Stars

4

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

暂无数据

最近更新

2026-07-31

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过自定义补丁将 llama.cpp 移植到 Nintendo Switch,证明 Tegra X1 在受限的 homebrew 环境中也能离线运行量化 LLM 模型。

适合谁使用

  • Nintendo Switch homebrew 用户
  • 对 llama.cpp 移植到非主流平台感兴趣的开发者
  • 希望离线运行本地 LLM 的隐私爱好者
  • 探索低功耗边缘 LLM 推理的硬件爱好者

典型使用场景

  • 在没有网络的情况下,在 Switch 上运行小型 Q4 GGUF 模型
  • 试验 llama.cpp 在 Tegra X1 上的 CPU 推理性能
  • 在 SD 卡上保存私密的多轮聊天记录
  • 使用 devkitPro 构建和扩展 homebrew LLM 控制台应用

项目优势

  • 完全离线、纯 CPU 运行,不依赖云服务或 GPU
  • 可将任意 .gguf 模型放入指定文件夹,并以纯文本保存多聊天历史
  • 自带 llama.cpp 的 Switch/newlib 补丁和工具链文件,方便复现构建
  • 提供简单的控制台 UI,支持模型选择和多聊天管理

使用前须知

  • 没有 GPU 加速;受 4 GB 内存限制,只能实际使用小型 Q4 模型
  • 推理速度约为每秒 1–3 个 token,属于实验玩具而非生产级推理栈
  • 每轮对话都会重新输入全部历史记录,长对话会变慢甚至超出上下文窗口;且只有控制台 UI

README 快速开始

Switch-Alpaka

Run local LLMs (GGUF models via llama.cpp) natively on a homebrew-enabled Nintendo Switch — no internet connection required. CPU-only inference, console-based UI, model picker, and persistent multi-chat history saved to the SD card. Disclaimer: This was Vibe Coded using Claude Sonnet 5

Features

  • Pick any .gguf model dropped into sdmc:/switch/llm/models/
  • Multiple saved chats per model, stored as plain text on the SD card
  • Multi-turn conversation context (not just single-shot Q&A)
  • Runs fully offline, CPU-only (Tegra X1, no GPU/CUDA support — see Background)

Requirements

  • A Switch with Atmosphère (or compatible) CFW and the homebrew launcher
  • devkitPro with devkitA64, switch-dev, and switch-tools installed
  • A quantized .gguf model (see Getting a model)

Building

1. Install devkitPro (if you haven't already)

wget https://apt.devkitpro.org/install-devkitpro-pacman
chmod +x ./install-devkitpro-pacman
sudo ./install-devkitpro-pacman
sudo dkp-pacman -S devkitA64 switch-dev switch-tools

Make sure your environment has:

export DEVKITPRO=/opt/devkitpro
export DEVKITA64=${DEVKITPRO}/devkitA64
export PATH=${DEVKITPRO}/tools/bin:${DEVKITA64}/bin:${PATH}

2. Clone and patch llama.cpp

llama.cpp doesn't support Horizon OS out of the box. This repo ships a patch that adds Switch/newlib compatibility (no dlfcn.h/mmap, missing posix_memalign/sysconf, forces the CPU backend, etc).

git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
git apply ../patches/llama-switch.patch

3. Cross-compile llama.cpp for the Switch

mkdir build-switch && cd build-switch
cmake .. -DCMAKE_TOOLCHAIN_FILE=../switch-toolchain.cmake \
  -DGGML_OPENMP=OFF \
  -DGGML_NATIVE=OFF \
  -DLLAMA_CURL=OFF \
  -DBUILD_SHARED_LIBS=OFF \
  -DCMAKE_BUILD_TYPE=Release \
  -DLLAMA_BUILD_TOOLS=OFF \
  -DLLAMA_BUILD_EXAMPLES=OFF \
  -DLLAMA_BUILD_SERVER=OFF \
  -DLLAMA_BUILD_TESTS=OFF \
  -DLLAMA_BUILD_APP=OFF \
  -DGGML_BACKEND_DL=OFF \
  -DGGML_CPU=ON \
  -DLLAMA_BUILD_COMMON=OFF
make -j$(nproc)
cd ../..

The toolchain file (switch-toolchain.cmake) is included in this repo — copy it into your llama.cpp checkout before running cmake:

cp switch-toolchain.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
jamesob
精选
jamesob GitHub avatar

local-llm

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.

AI 与机器学习大语言模型
1,660
makecindy
精选
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI 与机器学习大语言模型
958