agentleFS
LangChainKnown publisherlangchain-ai/langchain-litellm/AGENTS.md

langchain-litellm

AGENTS.md62 starsChanged 7 days agoMITView on GitHub

langchain-litellm is the LangChain integration for LiteLLM: chat models, embeddings and an OCR document loader that reach any provider litellm supports. This file is the shared context for every coding agent. People start at CONTRIBUTING.md. Before writing a commit message, PR title, PR description or branch name, or adding or removing a label, read .claude/skills/conventional-commits/SKILL.md. Run from the repo root with uv 0.12.22 or later. Do not update uv.lock or add dependencies to pyproject.toml without explicit maintainer permission.

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before writing a commit message, PR title, PR description or branch name, or adding or removing a label, read …

    line 5
  2. Distinctive:

    Run from the repo root with uv 0.12.22 or later.

    line 19
  3. Very specific:

    Do not update uv.lock or add dependencies to pyproject.toml without explicit maintainer permission.

    line 34
  4. Distinctive:

    Keep issue and PR numbers out of code comments and docstrings.

    line 44
  5. Distinctive:

    Update docstrings in the same PR as the behaviour they describe.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

langchain-litellm is the LangChain integration for LiteLLM: chat models, embeddings and an OCR document loader that reach any provider litellm supports. This file is the shared context for every coding agent. People start at CONTRIBUTING.md.

Before writing a commit message, PR title, PR description or branch name, or adding or removing a label, read .claude/skills/conventional-commits/SKILL.md.

Layout

  • langchain_litellm/chat_models/litellm.py: ChatLiteLLM.
  • langchain_litellm/chat_models/litellm_router.py: ChatLiteLLMRouter, a subclass that overrides _generate, _agenerate, _stream and _astream.
  • langchain_litellm/embeddings/: LiteLLMEmbeddings and LiteLLMEmbeddingsRouter.
  • langchain_litellm/document_loaders/litellm_ocr.py: LiteLLMOCRLoader.
  • tests/unit_tests/: offline; pytest-socket blocks the network.
  • tests/integration_tests/: real provider calls.
  • scripts/: the import check, the dependency-floor pins and the release-notes check that CI runs.

Commands

Run from the repo root with uv 0.12.22 or later.

  • make setup runs once per clone: uv sync, the pre-commit and pre-push hooks, and a git blame that skips the bulk reformat commits.
  • uv sync installs every dependency group into .venv, on the Python .python-version names, which CI lints with.
  • make test runs the unit tests with network sockets blocked. make test TEST_FILE=<path> runs any pytest path.
  • make test_matrix runs the unit tests on every Python version the classifiers in pyproject.toml list, as CI's matrix does.
  • make lint runs ruff check, ruff format --diff and mypy over the whole tree. This is the typecheck.
  • make format runs ruff check --fix --exit-zero and ruff format. It passes even when unfixable lint errors remain, so run make lint after it.
  • make spell_check runs codespell with the config in pyproject.toml.
  • make check_imports imports every module under langchain_litellm.
  • uv lock --check checks the lockfile, as CI does.
  • uv run pre-commit run --all-files runs every commit hook on the whole tree.
  • make check runs what CI runs on a PR, in CI's order, except the dependency-floor and newest-litellm jobs.
  • make integration_tests needs network access and provider credentials in .env, whose variable names .env.example lists. CI does not run it.

Do not update uv.lock or add dependencies to pyproject.toml without explicit maintainer permission.

Traps

  • ChatLiteLLMRouter overrides all four entry points of ChatLiteLLM, so a fix to one of them usually needs the same fix in the router. Read both files.
  • Streaming and non-streaming responses convert tool calls in separate code paths. Change both.
  • A parameter the caller did not set must be absent from the request, not sent as None. Some providers reject the key whatever its value.
  • Unit tests never touch the network. Mock litellm, and pass mock_response on each call: the constructor drops it, and the request then reaches the real provider.
  • CI also runs the unit tests with every runtime dependency at the lowest version pyproject.toml allows, so code that reads a field only recent litellm releases set must pass there too.
  • The classifiers in pyproject.toml are the one list of supported Python versions: CI's matrices and make test_matrix read them, and .python-version must name the lowest. A pre-commit hook checks that .python-version, the lowest classifier and the requires-python floor agree.
  • Keep issue and PR numbers out of code comments and docstrings.
  • Update docstrings in the same PR as the behaviour they describe. User-facing guides belong in the LangChain docs repository, not in README.md.
  • release-please writes CHANGELOG.md and the version numbers. Do not edit them.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.