Repository Analysis

mostlygeek/llama-swap

Reliable model swapping for any local OpenAI/Anthropic compatible server - llama.cpp, vllm, etc

2.4 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of mostlygeek/llama-swap, a Go project with 4,996 GitHub stars. SynthScan v2.0 examined 56,325 lines of code across 400 source files, recording 86 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 2.4 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

2.4
Adjusted Score
2.4
Raw Score
100%
Time Factor
2026-07-14
Last Push
5.0K
Stars
Go
Language
56.3K
Lines of Code
400
Files
86
Pattern Hits
2026-07-14
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 3MEDIUM 14LOW 69

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 86 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block59 hits · 52 pts
SeverityFileLineSnippetContext
LOWconfig.example.yaml1# add this modeline for validation in vscodeCOMMENT
LOWconfig.example.yaml21# - minimum value is 15 seconds, anything less will be set to this valueCOMMENT
LOWconfig.example.yaml41# handling requests, etc.COMMENT
LOWconfig.example.yaml61# captureBuffer: how many MBs to allocate for storing request/response capturesCOMMENT
LOWconfig.example.yaml81# - it is automatically incremented for every model that uses itCOMMENT
LOWconfig.example.yaml101globalTTL: 0COMMENT
LOWconfig.example.yaml141 # use environment variable macros to keep secrets out of the configCOMMENT
LOWconfig.example.yaml161# - the model's ID is available in the ${MODEL_ID} macro, also available in macros defined aboveCOMMENT
LOWconfig.example.yaml181 ${latest-llama}COMMENT
LOWconfig.example.yaml201 # - in the format: ENV_NAME=valueCOMMENT
LOWconfig.example.yaml221 # - a ttl of -1 will use the global TTL value as the defaultCOMMENT
LOWconfig.example.yaml241 # - recommended to stick to sampling parametersCOMMENT
LOWconfig.example.yaml301 b: 2COMMENT
LOWconfig.example.yaml321 # - useful for models running on slower hardware that need longer timeoutsCOMMENT
LOWconfig.example.yaml361 # context: the maximum token context length supportedCOMMENT
LOWconfig.example.yaml381 docker run --name ${MODEL_ID}COMMENT
LOWconfig.example.yaml401 # on_startup: a dictionary of actions to perform on startupCOMMENT
LOWconfig.example.yaml421# - matrix: the newer engine. More involved to configure, but far moreCOMMENT
LOWconfig.example.yaml441 # - behaviour is set per group with the `swap`, `exclusive` andCOMMENT
LOWconfig.example.yaml501 # costliest ones loaded.COMMENT
LOWconfig.example.yaml541 # +ref inline the expression of another setCOMMENT
LOWconfig.example.yaml621 keepalive: 30COMMENT
LOWdocker/build-image.sh1#!/bin/bashCOMMENT
LOWdocker/unified/build-image.sh1#!/bin/bashCOMMENT
LOWinternal/server/log.go21// wiring each one's output per the logToStdout config value. The proxy andCOMMENT
LOWinternal/chain/chain.go1// Package chain composes http.Handler middleware into a single handler.COMMENT
LOWinternal/perf/d3dkmt_windows.go141 // sizeof(D3DKMT_QUERYSTATISTICS) == 0x328 (808 bytes) on x64.COMMENT
LOWinternal/process/runtime_windows.go21// rooted at cmd.Process. Windows has no SIGTERM or process-group signalling, soCOMMENT
LOWinternal/process/process_command.go21COMMENT
LOWinternal/process/process_command.go561// immediately, which force-kills the process WaitDelay after the signalCOMMENT
LOWinternal/process/process_command_test.go321 }COMMENT
LOWinternal/process/process_command_forking_test.go21// `"$@"`). After SIGTERM the wrapper dies but the grandchild inherits theCOMMENT
LOWinternal/router/base.go141 }COMMENT
LOWinternal/router/base.go361}COMMENT
LOWinternal/router/scheduler/fifo.go81//COMMENT
LOWinternal/router/scheduler/scheduler.go21 "github.com/mostlygeek/llama-swap/internal/shared"COMMENT
LOWinternal/router/scheduler/scheduler.go41 // set EvictionFor was given for this decision. Planners may log theirCOMMENT
LOWinternal/router/scheduler/scheduler.go61 // OnUnload reconciles scheduler state for an unload, stops the targetedCOMMENT
LOWdocs/configuration.md101# copying this file into an LLM and asking it to explain or generateCOMMENT
LOWdocs/configuration.md121# - optional, default (disabled): ""COMMENT
LOWdocs/configuration.md141# - useful for limiting memory usage when processing large volumes of metricsCOMMENT
LOWdocs/configuration.md161 enable: trueCOMMENT
LOWdocs/configuration.md181COMMENT
LOWdocs/configuration.md201# - macro values can be numbers, bools, or stringsCOMMENT
LOWdocs/configuration.md221COMMENT
LOWdocs/configuration.md241models:COMMENT
LOWdocs/configuration.md261 --ctx-size ${default_ctx}COMMENT
LOWdocs/configuration.md281 - "CUDA_VISIBLE_DEVICES=0,1,2"COMMENT
LOWdocs/configuration.md301 # - a value of 0 disables automatic unloading of the modelCOMMENT
LOWdocs/configuration.md321COMMENT
LOWdocs/configuration.md381 # becomes: c: [0.7, false, "model: llama"]COMMENT
LOWdocs/configuration.md421COMMENT
LOWdocs/configuration.md441 # - processes have 5 seconds to shutdown until forceful termination is attemptedCOMMENT
LOWdocs/configuration.md461# 4. For each candidate set, compute cost: sum of evict_costs forCOMMENT
LOWdocs/configuration.md481 v: voxtral-modelCOMMENT
LOWdocs/configuration.md501 # "a | b" → [a], [b]COMMENT
LOWdocs/configuration.md521COMMENT
LOWdocs/configuration.md541# - peers can be any server that provides the /v1/ generative api endpoints supported by llama-swapCOMMENT
LOWdocs/configuration.md581 # filters: a dictionary of filter settings for peer requestsCOMMENT
Decorative Section Separators9 hits · 36 pts
SeverityFileLineSnippetContext
MEDIUMconfig.example.yaml5# -------------------------------------COMMENT
MEDIUMconfig.example.yaml8# ====================================COMMENT
MEDIUMconfig.example.yaml12# ====================================COMMENT
MEDIUM…/src/components/playground/ConcurrencyInterface.svelte130 // Detect and split the llama-swap loading block (wrapped in ━━━━━ markers,COMMENT
MEDIUMdocs/configuration.md96# -------------------------------------COMMENT
MEDIUMdocs/configuration.md99# ====================================COMMENT
MEDIUMdocs/configuration.md103# ====================================COMMENT
MEDIUMdocs/configuration.md444# =============================================================================COMMENT
MEDIUMdocs/configuration.md446# =============================================================================COMMENT
Synthetic Comment Markers3 hits · 20 pts
SeverityFileLineSnippetContext
HIGHconfig-schema.json490 "description": "Controls what is logged to stdout. 'proxy': logs generated by llama-swap, 'upstream': copy oCODE
HIGHconfig.example.yaml40# - "proxy": logs generated by llama-swap when swapping models,COMMENT
HIGHdocs/configuration.md131# - "proxy": logs generated by llama-swap when swapping models,COMMENT
Modern AI Meta-Vocabulary3 hits · 8 pts
SeverityFileLineSnippetContext
MEDIUMinternal/event/README.md3The original code uses a `time.Ticker` to process the event queue which caused a large increase in CPU usage ([#189](httCODE
MEDIUMdocs/newrouter-todo.md41## Phase 4 — `internal/server` package scaffolding (ProxyManager replacement) -- Completed.COMMENT
MEDIUMdocs/newrouter-todo.md68### Phase 4a — package scaffolding -- Completed.COMMENT
Redundant / Tautological Comments5 hits · 8 pts
SeverityFileLineSnippetContext
LOWdocker/build-container.sh32# Check if ARCH is in the allowed listCOMMENT
LOWdocker/build-container.sh38# Check if GITHUB_TOKEN is set and not emptyCOMMENT
LOWdocker/build-container.sh97 # Check if response is empty array (no more pages)COMMENT
LOWdocker/build-image.sh227# Check if our custom builder exists with the right config, create/update if neededCOMMENT
LOW.github/workflows/config-schema.yml28 # Check if the file is valid JSONCOMMENT
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOWdocker/build-image.sh5# Usage:COMMENT
LOWdocker/unified/build-image.sh5# Usage:COMMENT
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMdocker/build-image.sh237 # Create the builder with the configCOMMENT
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWcmd/fake-model/main.go21 "Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor " +CODE
LOWcmd/fake-model/main.go21 "Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor " +CODE
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMinternal/router/loading_remarks.go85 "The model saw \"As an AI language model\" and won't stop saying it now",CODE
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippetContext
LOWui-svelte/src/lib/playgroundInterface.ts22export function createPlaygroundInterface(CODE