Skip to content

Instantly share code, notes, and snippets.

@fewtarius
fewtarius / llama-cpp-ssd-cache.patch
Created November 11, 2026 01:30
CachyLLama SSD-backed KV cache, forward-ported to llama.cpp master aa75ff323
From 5f0e5a4b3ea0f35183a056e5da77be5502f3ce7e Mon Sep 17 00:00:00 2001
From: fewtarius <fewtarius@steamfork.org>
Date: Tue, 10 Nov 2026 20:22:41 -0500
Subject: [PATCH] common: add SSD-backed KV cache with hot/warm/cold tiering
Persist server prompt checkpoints on disk so a returned conversation can
restore mid-prompt state instead of re-prefilling. Three tiers: hot and
warm hold checkpoint state in RAM under explicit byte budgets, cold lives
only on SSD. Checkpoints are routed to a per-conversation directory keyed
by an FNV-1a hash of the leading prompt tokens.
@fewtarius
fewtarius / UninstallFromInternal.sh
Last active October 1, 2026 10:30
Uninstall Rocknix
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0
# Reverse installtointernal: restore Android userdata partition to original size
#
# This script DELETES the ROCKNIX and STORAGE partitions and expands
# the Android userdata partition back to fill the remaining disk space.
#
# Wipe the flash and storage partitions with dd, reboot with a microsd inserted, then run this script.
#
# Ex.
@fewtarius
fewtarius / clio_on_rocknix.md
Last active September 28, 2026 22:40
CLIO on Rocknix

CLIO on Rocknix - Installation Guide

This guide documents how to install CLIO (Command Line Intelligence Orchestrator) on Rocknix (an ARM64 Linux distribution for handheld gaming devices).


System Overview

Target Platform:

  • OS: Rocknix 20260901 (official build)
#!/bin/bash
# Restore script for Heroic game saves (SteamOS/SteamFork)
# Restores a selected game's save from backup to its original location
# Usage: ./restore_heroic_save.sh <GameName> <BackupFile>
SRC_DIR="/var/run/media/primary/Backups"
DEST_DIR="$HOME/Games/Heroic/Prefixes/default"
if [ "$#" -ne 2 ]; then
echo "Usage: $ <GameName> <BackupFile>"
#!/bin/bash
# Backup script for Heroic game saves (SteamOS/SteamFork)
# Each game's save is backed up individually with a time/date stamp
# Destination: /var/run/media/primary/Backups/
SRC_DIR="$HOME/Games/Heroic/Prefixes/default"
DEST_DIR="/var/run/media/primary/Backups"
DATE=$(date +'%Y%m%d_%H%M%S')
# Create destination if it doesn't exist

AMD APU Optimization Guide for llama.cpp on SteamOS

This guide documents the process to optimize and run large language models on AMD APUs (specifically 7840U with Radeon 780M, Ayaneo Flip w/ 32GB RAM) using llama.cpp with Vulkan acceleration.

Prerequisites

System Preparation

# Disable read-only filesystem (SteamOS specific)
sudo steamos-readonly disable

4w idle savings:

mkdir -p ${HOME}/.config/gamescope/scripts/displays/
cat <<EOF >${HOME}/.config/gamescope/scripts/displays/AYA-AYANEOFHD.lua
gamescope.config.known_displays.ayaneo_fhd_lcd.dynamic_refresh_rates = {60}
EOF

To revert, remove the configuration and reboot the device.

Add space to a MacOS Native image running in UTM

Install qemu to provide qemu-img

brew install qemu

Resize the raw image

# Stop the VM (no state so it is editable) and change into the Data directory
@fewtarius
fewtarius / install_vita3k.md
Last active June 6, 2024 16:18
Install Vita3K in SteamOS / SteamFork

Save to ~/install_vita3k.sh, make it executable, and execute it in Desktop Mode. Add the Vita3K shortcut to Steam.

#!/bin/sh

EMU="Vita3K"
DESKTOP_FILE="${EMU}.desktop"

APPS_PATH="${HOME}/Applications"
INSTALL_PATH="${HOME}/.config/${EMU}"
@fewtarius
fewtarius / rg35xx.dts
Created February 5, 2023 16:01 — forked from macromorgan/rg35xx.dts
Device Tree for RG35XX
/dts-v1/;
/ {
#address-cells = <0x01>;
#size-cells = <0x01>;
compatible = "actions,gs705a\0actions,atm7059a";
interrupt-parent = <0x01>;
model = "Actions GS705A board";
chosen {