agentmap
Map every AI API call in a codebase — offline, no LLM, no API keys. Run one command and get a webpage showing which files call which providers, what models you use, and what each agent is responsible for.
pip install agentmap-scan
cd your-project
agentmap
A browser page opens with four sections:
- Calls by file — every AI API call site,
file:line, provider-tagged. - Providers & models — the distinct providers and model names in use, with counts.
- Agents & responsibilities — each agent's name and what its system prompt says it does.
- Routing — the env vars to send those calls through a gateway.
How it works
Pure regex over your source — it matches provider endpoint hosts
(api.openai.com, api.anthropic.com, …) and SDK call signatures
(.chat.completions.create, .messages.create, …), so it finds calls in
Python, JS/TS, Go, Rust, Ruby, PHP, Java, shell/curl — not just the official
SDKs. Agent responsibilities come straight from the system prompts in your code,
trimmed to one line. Nothing leaves your machine.
Detects 20 providers: OpenAI, Anthropic, Google Gemini/Vertex, Azure OpenAI, DeepSeek, Groq, xAI, Mistral, Cohere, Bedrock, Together, Fireworks, OpenRouter, Perplexity, Replicate, Hugging Face, Ollama, LiteLLM, LangChain.
Commands
agentmap [PATH] # scan + open the report (default: current dir)
agentmap --no-open PATH # scan, write the HTML, don't launch a browser
agentmap install PATH # write .env.agentmap routing env vars
agentmap install PATH --auto # also rewrite hardcoded provider base_urls in place
Routing → save money
agentmap install writes the env vars that point your OpenAI/Anthropic-compatible
calls at a gateway. Point them at Brevitas
to compress context losslessly and cut your token bill:
agentmap install . --target http://localhost:4242
source .env.agentmap
Limitations (honest)
Agent detection is a heuristic. It reliably catches raw OpenAI/Anthropic message
dicts, system=/system_prompt=/instructions= assignments (incl. X_system,
X_PROMPT names), CrewAI Agent(role=…), and .agent("name") calls. It does
not yet understand graph frameworks (LangGraph node graphs, AutoGen). PRs
adding per-framework matchers welcome.
License
MIT.
Metadata
Release files for agentmap-scan 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentmap_scan-0.2.0.tar.gz | 30.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentmap_scan-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.7 kB
Release files / agentmap_scan-0.2.0.tar.gz
| Download URL | agentmap_scan-0.2.0.tar.gz |
|---|---|
| Size | 30.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a378782406dc8655b2d79d792ba588ed5f5e29d6fca7e139287c248927054367
|
|
BLAKE2b-256 checksum How to use checksums |
f634db06d83e7eaaf79a314aa169556cfb3e1f39273aa8bdfbd118e835d96a77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / agentmap_scan-0.2.0-py3-none-any.whl
| Download URL | agentmap_scan-0.2.0-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f582452fb5d136c86dc322167d1eee6a09a2e85cb5c3e7dca635c3f2b5c940d6
|
|
BLAKE2b-256 checksum How to use checksums |
5d1b4f7d2f26080eaf53421b210a552b53247c19619deebff626a78ed64e6253
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|