Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentmap_scan-0.1.1.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentmap_scan-0.1.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file agentmap_scan-0.1.1.tar.gz.

File metadata

  • Download URL: agentmap_scan-0.1.1.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for agentmap_scan-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a77ed405dde87569c66bab9966abc8c4874fb8e9c01dd13aebcf1f259476931e
MD5 9e1bd1f54dab8c3cb1141f4ac827cdfa
BLAKE2b-256 63c0b9061f6a6952e3f2583c09faacc0891ce0ed5b59964f6c5aeb432b66a396

See more details on using hashes here.

File details

Details for the file agentmap_scan-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: agentmap_scan-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for agentmap_scan-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 276fa1865b85ab286e9131498acb8769e9c3a22b67aa8f94a00fef4bf5912c08
MD5 617cbdfef671146abf68c99ee8c6b07d
BLAKE2b-256 52d5d223346c14e39d62a303519ee3c093175b1fb633f8072946d9c8f24148e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page