maclocal-api AGENTS.md

A repository guide for maclocal-api, a Swift project that provides an OpenAI-compatible HTTP server for local AI models.

In plain words
What is it for?
Use it when modifying the command-line tool, server, tests, scripts, or dependencies, especially when working with Swift Package Manager.
Why use it?
It prevents provider code from being duplicated or changed in the wrong package and defines the approved build, test, and project-organization rules.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/scouzi1966/maclocal-api/agents-md
Clone the repo
git clone --depth 1 https://github.com/scouzi1966/maclocal-api

Made for: Codex, OpenCode.

Per session 1,269 This file is loaded in full into every session.
When invoked 1,269 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01269 $0.01269
Opus 5 $0.00634 $0.00634
Sonnet 5 $0.00254 $0.00254
Haiku 4.5 $0.00127 $0.00127

Measured 2d ago against content hash ca0d84e42f25, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

maclocal-api AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 57 lines

How it starts

The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Repository Guidelines

See CLAUDE.md for additional project-specific build, architecture, and workflow reference details.

Project Structure & Module Organization

Sources/AFMCLI/ contains the CLI, Sources/AFMServer/ owns Vapor and the OpenAI HTTP boundary, and Sources/AFMKit/ is maclocal-api's aggregate facade. The standalone provider contracts and runtimes come from the pinned AFMKit package. Tests live in Tests/MacLocalAPITests/; automation and regression scripts are in Scripts/, design notes in docs/, and generated artifacts in test-reports/ and archive/.

vendor/ contains only application-owned submodules such as llama.cpp. MLX, mlx-c, mlx-swift-lm, xgrammar, and DwarfStar provider sources are owned by the exact-versioned AFMKit package. Do not add shadow provider implementations or patch resolved SwiftPM checkouts in this consumer; make provider changes in AFMKit and then bump the single AFMKit version.

Build, Test, and Development Commands

Use the project Makefile for normal workflows. All direct SwiftPM build and test invocations must go through Scripts/swiftpm-reliable.sh; do not invoke raw swift build or swift test. The wrapper selects the reliable Xcode 27 driver, repairs stale explicit-module state once, and stages the canonical MLX metallib beside every XCTest executable for MLX's C++ runtime. The default package graph pins one exact AFMKit version, which owns every provider source and runtime dependency. A local AFMKit workspace path is supported only for paired development before the exact-version bump. This applies to release/coverage harness scripts and copied XCTest reruns too; do not replace the wrapper with raw swift test or a one-off environment fix.

  • make build verifies the AFMKit consumer boundary and builds the release afm binary without mutating vendor sources.
  • make debug builds a debug binary at .build/debug/afm.
  • make run starts the debug server on port 9999.
  • make test performs the basic binary and portability checks.
  • ./Scripts/build-from-scratch.sh runs the full clean consumer build, including submodules and WebUI assets, against immutable package dependencies.
  • Scripts/swiftpm-reliable.sh build -c release --product afm builds AFM directly.
  • Scripts/swiftpm-reliable.sh test -c release runs the Swift unit test suite directly.
  • ./Scripts/test-assertions.sh --tier smoke --model <model> runs the broader assertion and integration harness.

Read the full file on GitHub · 57 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 57 lines · 1,269 tokens per session scan A ca0d84e42f25

Subscribe to this mod's changes

maclocal-api AGENTS.md is an instructions file published in the GitHub repository scouzi1966/maclocal-api (334 stars, last pushed 2d ago), licensed MIT. It adds 1,269 tokens to every session, about $0.0063 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

osaurus AGENTS.md

AGENTS.md instructions for osaurus-ai/osaurus, covering codex configuration - osaurus-staging, build & test, keychain tip (optional), osaurus release proof and pr reporting and model runtime non-negotiables.

osaurus-ai/osaurus · 2,723 tokens

Swift-Foundation-Models-Skills AGENTS.md

Instructions for sambitcreate/Swift-Foundation-Models-Skills, covering apple foundation models skills repository, skills overview, core session management, structured generation and tools & system integration.

sambitcreate/Swift-Foundation-Models-Skills · 1,534 tokens

apfel CLAUDE.md

Instructions for Arthur-Ficial/apfel, covering apfel - project instructions, the golden goal, core product (this is what apfel is), byproducts (useful, but not the pitch) and readme.md structure rule.

Arthur-Ficial/apfel · 7,076 tokens

strix-halo-guide AGENTS.md

Instructions for hogeheer499-commits/strix-halo-guide, covering agents.md, core project lens, documentation style, do-not-invent rules and benchmark claim rules.

hogeheer499-commits/strix-halo-guide · 2,053 tokens

row-bot CLAUDE.md

Instructions for siddsachar/row-bot, a project described as: Row-Bot - Personal AI Sovereignty. A local-first AI assistant with integrated tools, a personal knowledge graph, voice, vision, shell, browser automation, scheduled tasks, health tracking, and messaging channels. Run locally via Ollama or add opt-in cloud…

siddsachar/row-bot · 38 tokens

scarf AGENTS.md

Instructions for awizemann/scarf: This repo carries its own agent memory — plain files in git, served by the in-repo memophant-mcp MCP server, managed by the Memophant macOS app. It works the same for every agent (Claude Code, Codex, Cursor, Gemini, Copilot). This block is regenerated between the memophant markers…

awizemann/scarf · 1,629 tokens