LocalAI: Instructions file for Codex

AGENTS.md

LocalAI AGENTS.md is an instructions file for Codex, OpenCode from mudler/LocalAI. It costs 2,242 tokens per session, scanned A, original, MIT.

A set of instructions for AI coding assistants working on the LocalAI project. It points assistants to relevant project guides and explains rules for reviewing, testing, and attributing AI-assisted contributions.

In plain words
What is it for?
Use it when an AI assistant changes LocalAI code and needs guidance on contribution policy, development workflow, or the relevant topic-specific instructions.
Why use it?
It helps an assistant follow LocalAI's contribution process instead of guessing which project rules apply. It also reduces mistakes in commit attribution and required review responsibilities.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions Codex; built for aider.

This is mudler/LocalAI's own configuration. It tells Codex and OpenCode how to work on LocalAI itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything LocalAI configures →

About the project

LocalAI is an inference server that runs language, vision, voice, image, and video models through compatible APIs on local hardware. It is used to operate models privately across different hardware, including CPU-only systems, and supports applications, agents, and multi-user services. The catalogue contains instructions for using LocalAI.

mudler/LocalAI · 50,218 stars · on GitHub · localai.io

Reuse

Borrowing it

Nothing to install: this file belongs to mudler/LocalAI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mudler/LocalAI/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/mudler/LocalAI

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for LocalAI AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mudler/localai/agents-md/github.svg)](https://agentmods.dev/instructions/mudler/localai/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/mudler/localai/agents-md"><img src="https://agentmods.dev/badge/instructions/mudler/localai/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for LocalAI AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/mudler/localai/agents-md"><img src="https://agentmods.dev/badge/instructions/mudler/localai/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,242 This file is loaded in full into every session.
When invoked 2,242 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02242 $0.02242
Opus 5.5 $0.00897 $0.00897
Sonnet 5.5 $0.00448 $0.00448
Haiku 4.5 $0.00224 $0.00224

Measured 3d ago against content hash b41952a26229, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

LocalAI 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 3d 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.

LocalAI Agent Instructions

This file is the entry point for AI coding assistants (Claude Code, Cursor, Copilot, Codex, Aider, etc.) working on LocalAI. It is an index to detailed topic guides in the .agents/ directory. Read the relevant file(s) for the task at hand — you don't need to load all of them.

Human contributors: see CONTRIBUTING.md for the development workflow.

Policy for AI-Assisted Contributions

LocalAI follows the Linux kernel project's guidelines for AI coding assistants. Before submitting AI-assisted code, read .agents/ai-coding-assistants.md. Key rules:

  • No Signed-off-by from AI. Only the human submitter may sign off on the Developer Certificate of Origin. One exception: automation a maintainer operates signs off with that maintainer's identity, since no other human submitter exists to certify it. See .agents/ai-coding-assistants.md.
  • No Co-Authored-By: <AI> trailers. The human contributor owns the change.
  • Use an Assisted-by: trailer to attribute AI involvement. Format: Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2].
  • The human submitter is responsible for reviewing, testing, and understanding every line of generated code.

Topics

File When to read
.agents/ai-coding-assistants.md Policy for AI-assisted contributions — licensing, DCO, attribution
.agents/building-and-testing.md Building the project, running tests, Docker builds for specific platforms
.agents/ci-caching.md CI build cache layout (registry-backed BuildKit cache on quay.io/go-skynet/ci-cache, per-arch keys), DEPS_REFRESH weekly cache-buster for unpinned Python deps, prebuilt base-grpc-* images for llama.cpp variants, per-arch native + manifest-merge pattern, setup-build-disk /mnt relocation, path filter on master push, manual eviction
.agents/adding-backends.md Adding a new backend (Python, Go, or C++) — full step-by-step checklist, including importer integration (the /import-model dropdown is server-driven from GET /backends/known)
.agents/coding-style.md Code style, editorconfig, logging, documentation conventions
.agents/llama-cpp-backend.md Working on the llama.cpp backend — architecture, updating, tool call parsing
.agents/vllm-backend.md Working on the vLLM / vLLM-omni backends — native parsers, ChatDelta, CPU build, libnuma packaging, backend hooks
.agents/sglang-backend.md Working on the SGLang backend — engine_args validation against ServerArgs, speculative-decoding (EAGLE/EAGLE3/DFLASH/MTP) recipes, parser handling
.agents/ds4-backend.md Working on the ds4 backend - DSML state machine, thinking modes, KV cache, Metal+CUDA matrix
.agents/testing-mcp-apps.md Testing MCP Apps (interactive tool UIs) in the React UI
.agents/api-endpoints-and-auth.md Adding API endpoints, auth middleware, feature permissions, user access control
.agents/debugging-backends.md Debugging runtime backend failures, dependency conflicts, rebuilding backends
.agents/adding-gallery-models.md Adding GGUF models from HuggingFace to the model gallery
.agents/localai-assistant-mcp.md LocalAI Assistant chat modality — adding admin tools to the in-process MCP server, editing skill prompts, keeping REST + MCP + skills in sync
.agents/backend-signing.md Backend OCI image signing (keyless cosign + sigstore-go) — producer-side CI setup, consumer-side gallery verification: block, strict mode (LOCALAI_REQUIRE_BACKEND_INTEGRITY), revocation via not_before
.agents/preparing-a-release.md Cutting a release: PR labels, RELEASE_NOTES_vX.Y.Z.md, the blog post under website/content/blog/, and the demo clips under website/static/media/
.agents/distributed-state.md Features that keep runtime state — how they must behave with several frontends (syncstate, advisory-lock leaders, fakebus tests)
.agents/distributed-seams.md Distributed mode transports: the fan-out, queue, control verb, agent RPC and dial seams, subject rules, the no-route contract, conformance suites, open items for a second carrier
.impeccable.md Design context for UI/UX work — users, brand personality, aesthetic direction, and design principles

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. 3d ago Changed · +2 lines · +99 tokens per session b41952a26229
  2. 15d ago Changed · +25 tokens per session 338dcca2dac8
  3. 1mo ago Changed · +1 lines · +56 tokens per session 0f50aac48a30
  4. 1mo ago Changed · +2 lines · +114 tokens per session e4c639caaa58
  5. 2mo ago Changed · +53 tokens per session cc7a45ac890e
  6. 2mo ago First seen · 52 lines · 1,895 tokens per session scan A 3a2d1358db1a

Subscribe to this mod's changes

LocalAI AGENTS.md is an instructions file published in the GitHub repository mudler/LocalAI (50,218 stars, last pushed yesterday), licensed MIT. It adds 2,242 tokens to every session, about $0.0090 per session on Opus 5.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

LocalAI AGENTS.md compared with instructions from other repositories

LocalAI AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
LocalAI AGENTS.mdmudler/LocalAIInstructions file50kyesterdayMITA2,242Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode