whatisgithub

What is localaihotswap?

aa2448208027-code/localaihotswap — explained in plain English

Analysis updated 2026-05-18

39PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A proxy that sits in front of llama.cpp and lets you swap local AI models mid-conversation without losing chat history.

Mindmap

mindmap
  root((LocalAIHotSwap))
    What it does
      Swaps local AI models
      Keeps conversation history
      Manages GPU memory
    Tech stack
      Python
      llama.cpp
      TOML config
    Use cases
      Compare local models
      Run on limited VRAM
      OpenAI-compatible proxy
    Audience
      Developers running local AI
    Setup
      Configure TOML file
      Point to model files
      Start proxy

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Compare outputs from multiple local AI models in the same conversation without restarting or losing context.

USE CASE 2

Run experiments across different local models on GPU-limited hardware by unloading one before loading the next.

USE CASE 3

Point existing OpenAI-API-compatible tools at this proxy without changing their request format.

What is it built with?

Pythonllama.cppTOML

How does it compare?

aa2448208027-code/localaihotswapamapvoice/pilotttsbennjordan/kirlianorbits_win64
Stars393939
LanguagePythonPythonPython
Setup difficultymoderatehardmoderate
Complexity3/54/53/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a working llama.cpp setup and local model files in addition to this proxy.

The excerpt does not state a license, so terms for reuse and redistribution are unclear from the available text.

So what is it?

LocalAIHotSwap is a small control layer that sits in front of a locally running AI model server called llama.cpp. Its job is to let you swap out one AI model for another while keeping your conversation history intact, without needing to restart everything from scratch. When you run AI models locally, each model is a large file that must be loaded into your GPU's memory before it can respond to questions. Switching between models normally means losing whatever context the conversation had built up. This project solves that by acting as a middleman: it stores your conversation messages and any preset instructions separately from the model server itself, then coordinates the unloading and reloading of model files in a way that keeps memory usage low. The default approach, called zero_overlap, unloads the current model completely before loading the next one. This avoids having two large model files in GPU memory at the same time, which matters a lot on machines with limited VRAM. Once the new model is loaded, the saved conversation history is fed back in so the chat can continue. The project is honest that this replay step does take time, and that there is no shortcut around it. From the user's perspective, the proxy accepts chat requests in the same format that OpenAI's API uses, so existing tools that speak that format work without changes. You can also send a switch command to change which model is active, and the proxy makes sure any in-progress responses finish before the old model is unloaded. Configuration is handled through a TOML file where you point to your local model files and set limits like how many messages to keep in history, how large the context window can be, and how long to wait for active requests to drain before switching. The project is aimed at developers running experiments across multiple local models who want to compare outputs without constantly losing their session state.

Copy-paste prompts

Prompt 1
Help me write a TOML config file pointing this proxy at two local GGUF model files.
Prompt 2
Explain how zero_overlap model swapping avoids running out of GPU memory.
Prompt 3
Show me how to send a switch command to change the active model mid-session.
Prompt 4
Walk me through connecting an existing OpenAI-API client to this proxy instead of the real OpenAI API.

Frequently asked questions

What is localaihotswap?

A proxy that sits in front of llama.cpp and lets you swap local AI models mid-conversation without losing chat history.

What language is localaihotswap written in?

Mainly Python. The stack also includes Python, llama.cpp, TOML.

What license does localaihotswap use?

The excerpt does not state a license, so terms for reuse and redistribution are unclear from the available text.

How hard is localaihotswap to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is localaihotswap for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.