Reliable model swapping for any local OpenAI/Anthropic compatible server - llama.cpp, vllm, etc
This report summarizes scanner evidence for mostlygeek/llama-swap, a Go project with 6,146 GitHub stars. SynthScan examined 122,392 lines of code across 750 source files, recording 175 pattern matches distributed across 14 syntactic categories. The legacy adjusted pattern signal is 2.3 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 140 finding(s).
Are imports declared and package/API names verified? 8 finding(s).
Are wrappers, guards, and repeated structures necessary? 34 finding(s).
Which changes need focused human review? 175 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 175 distinct pattern matches across 14 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ui/src/lib/tailcatPeerConfig.ts | 1 | // yamlQuote renders a value as a double-quoted YAML scalar. JSON's escaping | COMMENT |
| LOW | ui/src/lib/ime.ts | 1 | // Helpers for telling an IME conversion-confirming Enter apart from an Enter | COMMENT |
| LOW | cmd/kubeswap/serve.go | 41 | COMMENT | |
| LOW | cmd/kubeswap/main.go | 1 | // kubeswap is a cmd/cmdStop wrapper that lets llama-swap manage inference | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 1 | # Default values for llama-swap. | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 41 | # --------------------------------------------------------------------------- | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 101 | # write the model ID, the backend args, and any llama-swap model fields. | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 121 | # field (name, ttl, capabilities, macros, filters, aliases, | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 141 | # so the matrix DSL is never written by hand. Requires models (not | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 161 | # | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 181 | # krea2-turbo: 10 | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 261 | port: 80 | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 321 | httpGet: | COMMENT |
| LOW | cmd/kubeswap/chart/values.yaml | 341 | # resources: | COMMENT |
| LOW | evals/docs-agent/run.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | evals/docs-agent/fixture/models.yaml | 1 | # A long, deterministic configuration for the Docs Agent eval. | COMMENT |
| LOW | docker/build-image.sh | 1 | #!/bin/bash | COMMENT |
| LOW | docker/unified/lib-release.sh | 1 | #!/bin/bash | COMMENT |
| LOW | docker/unified/run.sh | 1 | #!/bin/bash | COMMENT |
| LOW | docker/unified/run.sh | 21 | # and exit instead of serving, so as a standing environment variable on a | COMMENT |
| LOW | docker/unified/config.example.yaml | 1 | # Starter configuration for the llama-swap container. | COMMENT |
| LOW | docker/unified/build-image.sh | 1 | #!/bin/bash | COMMENT |
| LOW | docker/unified/build-image.sh | 21 | # base-<backend>.Dockerfile the builder base, published as its own image | COMMENT |
| LOW | docker/unified/build-image.sh | 41 | # ./build-image.sh --cuda --stage=whisper # build + push one project's artifacts | COMMENT |
| LOW | docker/unified/build-image.sh | 181 | ARCH_TAG="" | COMMENT |
| LOW | docker/unified/build-image.sh | 201 | # parts that exist are Grace pairings, so Pascal through Ada are pointless and | COMMENT |
| LOW | docker/unified/install-audio.sh | 21 | git checkout FETCH_HEAD | COMMENT |
| LOW | internal/mcptools/provider.go | 41 | // Tags are internal metadata for a future find_tools; never serialized. | COMMENT |
| LOW | internal/mcptools/provider.go | 61 | Content string | COMMENT |
| LOW | internal/mcptools/registry.go | 21 | var ErrInvalidCursor = errors.New("invalid cursor") | COMMENT |
| LOW | internal/docagent/reference.go | 1 | // Package docagent indexes llama-swap's own documentation so it can be | COMMENT |
| LOW | internal/hw/intel.go | 1 | package hw | COMMENT |
| LOW | internal/capcompat/service.go | 41 | // | COMMENT |
| LOW | internal/capcompat/capcompat_test.go | 21 | // The fixtures under testdata/ are built from the documented response shapes: | COMMENT |
| LOW | internal/capcompat/capcompat_test.go | 41 | // | COMMENT |
| LOW | internal/capcompat/capcompat_test.go | 61 | // a single llama-server (b11429) serving the Clef-Flash decision model. The | COMMENT |
| LOW | internal/capcompat/llamaserver.go | 141 | } | COMMENT |
| LOW | internal/capcompat/default.go | 1 | package capcompat | COMMENT |
| LOW | internal/capcompat/capcompat.go | 1 | // Package capcompat discovers what an upstream inference server can do and | COMMENT |
| LOW | internal/capcompat/capcompat.go | 221 | logger *logmon.Monitor | COMMENT |
| LOW | internal/config/model_config.go | 61 | } | COMMENT |
| LOW | internal/config/mcpprovider.go | 21 | COMMENT | |
| LOW | internal/config/mcpprovider.go | 41 | // at 32KB, so nothing a caller has any business asking for comes near this. | COMMENT |
| LOW | internal/config/mcpprovider.go | 61 | // however much one such step adds; sampling often keeps that bounded. | COMMENT |
| LOW | internal/config/security.go | 41 | } | COMMENT |
| LOW | internal/config/security.go | 61 | // "allow everything". A "*" entry allows any origin and cannot be | COMMENT |
| LOW | internal/config/macros.go | 61 | // configuration is decoded. Decoding into untyped values first materializes | COMMENT |
| LOW | internal/config/redact.go | 41 | COMMENT | |
| LOW | internal/server/cors.go | 161 | if p.allowPrivateNetwork && r.Header.Get("Access-Control-Request-Private-Network") == "true" { | COMMENT |
| LOW | internal/server/server.go | 41 | metrics *metricsMonitor | COMMENT |
| LOW | internal/server/captures.go | 61 | // Each in-flight EncodeAll holds one sub-encoder, so this is also the number | COMMENT |
| LOW | internal/server/api.go | 481 | // responses resolve. The Location stays relative so the redirect keeps a | COMMENT |
| LOW | internal/chain/chain.go | 1 | // Package chain composes http.Handler middleware into a single handler. | COMMENT |
| LOW | internal/perf/d3dkmt_windows.go | 141 | // sizeof(D3DKMT_QUERYSTATISTICS) == 0x328 (808 bytes) on x64. | COMMENT |
| LOW | internal/matrix/doc.go | 1 | // Package matrix compiles and solves the matrix routing DSL without | COMMENT |
| LOW | internal/matrix/doc.go | 21 | // | COMMENT |
| LOW | internal/matrix/doc.go | 41 | // produce a worse decision. | COMMENT |
| LOW | internal/swaputil/http.go | 81 | COMMENT | |
| LOW | internal/process/runtime_windows.go | 21 | // rooted at cmd.Process. Windows has no SIGTERM or process-group signalling, so | COMMENT |
| LOW | internal/process/process_command.go | 21 | ) | COMMENT |
| 51 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …/src/components/playground/ConcurrencyInterface.svelte | 142 | // Detect and split the llama-swap loading block (wrapped in ━━━━━ markers, | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 13 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 15 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 41 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 43 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 94 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 96 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 137 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 139 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 195 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 197 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 223 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 225 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 270 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 272 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 290 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 292 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 327 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | cmd/kubeswap/chart/values.yaml | 329 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | docker/unified/build-image.sh | 403 | # ── --manifest: join the per-platform images into one tag ───────────── | COMMENT |
| MEDIUM | docker/unified/build-image.sh | 468 | # ── Resolve refs ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | docker/unified/build-image.sh | 563 | # ── Builders ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | docker/unified/build-image.sh | 664 | # ── --stage: build and publish one image ────────────────────────────── | COMMENT |
| MEDIUM | docker/unified/build-image.sh | 698 | # ── --assemble: runtime image from published artifacts ──────────────── | COMMENT |
| MEDIUM⚡ | docs/config.example.yaml | 5 | # ------------------------------------- | COMMENT |
| MEDIUM⚡ | docs/config.example.yaml | 8 | # ==================================== | COMMENT |
| MEDIUM⚡ | docs/config.example.yaml | 12 | # ==================================== | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | internal/config/matrix_test.go | 350 | assert.Same(t, cfg.Matrix.Program(), cfg.Routing.Router.Settings.Matrix.Program()) | CODE |
| CRITICAL | internal/config/config_test.go | 1827 | assert.NotNil(t, cfg.Routing.Router.Settings.Matrix.Program()) | CODE |
| CRITICAL | internal/config/config_test.go | 1847 | assert.NotNil(t, cfg.Routing.Router.Settings.Matrix.Program()) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | config-schema.json | 728 | "description": "Controls which log streams are written to stdout. A comma separated list of 'proxy' (logs ge | CODE |
| HIGH | docs/config.example.yaml | 43 | # - "proxy": logs generated by llama-swap when swapping models, | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | ui/src/components/playground/ChatInterface.svelte | 50 | // A history left over from when this tab was agentic still holds tool | COMMENT |
| MEDIUM | internal/server/server.go | 47 | // Playground's agentic chat and to external MCP clients through /api/mcp. | COMMENT |
| MEDIUM | internal/server/server.go | 482 | // consumed by the Playground's agentic chat and by any external MCP client. | COMMENT |
| MEDIUM | internal/event/README.md | 3 | The original code uses a `time.Ticker` to process the event queue which caused a large increase in CPU usage ([#189](htt | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docker/build-container.sh | 32 | # Check if ARCH is in the allowed list | COMMENT |
| LOW | docker/build-container.sh | 38 | # Check if GITHUB_TOKEN is set and not empty | COMMENT |
| LOW | docker/build-container.sh | 97 | # Check if response is empty array (no more pages) | COMMENT |
| LOW | docker/build-image.sh | 227 | # Check if our custom builder exists with the right config, create/update if needed | COMMENT |
| LOW | .github/workflows/config-schema.yml | 28 | # Check if the file is valid JSON | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ui/src/stores/playground.ts | 24 | export function resetUnknownPlaygroundTab(): void { | CODE |
| LOW | ui/src/components/ActivityTable.svelte | 669 | function handleInflightColDragStart(e: DragEvent, id: string) { | CODE |
| LOW | ui/src/components/ActivityTable.svelte | 677 | function handleInflightColDragOver(e: DragEvent, id: string) { | CODE |
| LOW | ui/src/components/playground/DocsInterface.svelte | 466 | function looksLikeUnparsedToolCall(text: string): boolean { | CODE |
| LOW | ui/src/lib/chatApi.ts | 303 | export function normalizeAnthropicStopReason(reason: unknown): string | undefined { | CODE |
| LOW | ui/src/lib/playgroundInterface.ts | 22 | export function createPlaygroundInterface( | CODE |
| LOW | ui/src/lib/playgroundSession.ts | 4 | function createPlaygroundSessionID(): string { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/add-changelog.sh | 2 | # Add a CHANGELOG.md entry by asking an AI coding harness to follow the | COMMENT |
| MEDIUM | scripts/add-changelog.sh | 103 | # The harness is optional: a leading v<number> is taken as the version. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | cmd/fake-model/README.md | 20 | lorem ipsum and it ignores the prompt. | CODE |
| LOW | cmd/fake-model/main.go | 21 | "Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor " + | CODE |
| LOW | cmd/fake-model/main.go | 21 | "Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor " + | CODE |
| LOW | docs/kb/guides/tools/fake-model.md | 13 | `/v1/chat/completions` with lorem ipsum at a fixed speed. It loads no model, so | CODE |
| LOW | docs/testing/synthetic-data.md | 87 | - **Determinism is the point.** The text is lorem ipsum and the prompt is | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | evals/docs-agent/run.sh | 15 | # Usage: | COMMENT |
| LOW | docker/build-image.sh | 5 | # Usage: | COMMENT |
| LOW | docker/unified/build-image.sh | 5 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | cmd/vllm-wrapper/main.go | 89 | // Step 1: Ensure the daemon is running and awake. | COMMENT |
| LOW | cmd/vllm-wrapper/main.go | 121 | // Step 2: Set up reverse proxy from listenAddr to vllmURL. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | cmd/vllm-wrapper/main.go | 89 | // Step 1: Ensure the daemon is running and awake. | COMMENT |
| LOW | cmd/vllm-wrapper/main.go | 121 | // Step 2: Set up reverse proxy from listenAddr to vllmURL. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docker/build-image.sh | 237 | # Create the builder with the config | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | internal/router/loading_remarks.go | 85 | "The model saw \"As an AI language model\" and won't stop saying it now", | CODE |