{"owner":"replicate","repo":"cog","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance to coding agents when working with code in this repository.\n\n## Project Overview\n\nCog is a tool that packages machine learning models in production-ready containers.\n\nIt consists of:\n\n- **Cog CLI** (`cmd/cog/`) - Command-line interface for building, running, and deploying models, written in Go\n- **Python SDK** (`python/cog/`) - Python library for defining model predictors and training in Python\n- **Coglet** (`crates/`) - Rust-based prediction server that runs inside containers, with Python bindings via PyO3\n\nDocumentation for the CLI and SDK is available by reading ./docs/llms.txt.\n\n## Development Commands\n\nDevelopment tasks are managed with [mise](https://mise.jdx.dev/). Run `mise tasks` to see all available tasks.\n\n### Quick Reference\n\n| Task                          | Description                                                  |\n| ----------------------------- | ------------------------------------------------------------ |\n| `mise run fmt`                | Check formatting (all languages)                             |\n| `mise run fmt:fix`            | Fix formatting (all languages)                               |\n| `mise run lint`               | Run linters (all languages)                                  |\n| `mise run lint:fix`           | Fix lint issues (all languages)                              |\n| `mise run test:go`            | Run Go tests                                                 |\n| `mise run test:rust`          | Run Rust tests                                               |\n| `mise run test:python`        | Run Python tests                                             |\n| `mise run test:integration`   | Run integration tests                                        |\n| `mise run build:cog`          | Build cog CLI binary                                         |\n| `mise run build:coglet`       | Build coglet wheel (dev)                                     |\n| `mise run build:sdk`          | Build SDK wheel                                              |\n| `mise run install`            | Build and symlink cog to /usr/local/bin                      |\n| `mise run docs:llm`           | **IMPORTANT:** Regenerate `docs/llms.txt` after editing docs |\n| `mise run docs:cli`           | Generate CLI reference docs from Go source code              |\n| `mise run version`            | Show current version from VERSION.txt                        |\n| `mise run version:bump <ver>` | Bump version everywhere and commit                           |\n\n### Task Naming Convention\n\nTasks follow a consistent naming pattern:\n\n- **Language-based tasks** for fmt/lint/test/typecheck: `task:go`, `task:rust`, `task:python`\n- **Component-based tasks** for build: `build:cog`, `build:coglet`, `build:sdk`\n- **Check vs Fix**: `fmt` and `lint` default to check mode (non-destructive); use `:fix` suffix to auto-fix\n\n### All Tasks by Category\n\n**Format:**\n\n- `mise run fmt` / `mise run fmt:check` - Check all (alias)\n- `mise run fmt:fix` - Fix all\n- `mise run fmt:go` / `mise run fmt:rust` / `mise run fmt:python` - Per-language\n\n**Lint:**\n\n- `mise run lint` / `mise run lint:check` - Check all (alias)\n- `mise run lint:fix` - Fix all\n- `mise run lint:go` / `mise run lint:rust` / `mise run lint:python` - Per-language\n- `mise run lint:rust:deny` - Check Rust licenses/advisories\n\n**Test:**\n\n- `mise run test:go` - Go unit tests\n- `mise run test:rust` - Rust unit tests\n- `mise run test:python` - Python unit tests (via tox)\n- `mise run test:coglet:python` - Coglet Python binding tests\n- `mise run test:integration` - Integration tests\n\n**Build:**\n\n- `mise run build:cog` - Build cog CLI (development)\n- `mise run build:cog:release` - Build cog CLI (release)\n- `mise run build:coglet` - Build coglet wheel (dev install)\n- `mise run build:coglet:wheel` - Build coglet wheel (native platform)\n- `mise run build:coglet:wheel:linux-x64` - Build for Linux x86_64\n- `mise run build:coglet:wheel:linux-arm64` - Build for Linux ARM64\n- `mise run build:sdk` - Build SDK wheel\n\n**Install:**\n\n- `mise run install` - Symlink cog CLI to `/usr/local/bin` (requires `build:cog` first)\n- `PREFIX=/custom/path mise run install` - Symlink to custom location\n\n**Version:**\n\n- `mise run version` - Show current version from VERSION.txt\n- `mise run version:bump <ver>` - Bump version everywhere and commit\n- `mise run version:check` - Verify VERSION.txt matches Cargo.toml\n\n**Other:**\n\n- `mise run typecheck` - Type check all languages\n- `mise run generate` - Run code generation\n- `mise run clean` - Clean all build artifacts\n- `mise run docs` - Build documentation\n- `mise run docs:serve` - Serve docs locally\n\n## Code Style Guidelines\n\n### Go\n\n- **Imports**: Organize in three groups separated by blank lines: (1) Standard library, (2) Third-party packages, (3) Internal packages (`github.com/replicate/cog/pkg/...`)\n- **Formatting**: Use `mise run fmt:go:fix`\n- **Linting**: Must pass golangci-lint with: errcheck, gocritic, gosec, govet, ineffassign, misspell, revive, staticcheck, unused\n- **Error Handling**: Return errors as values; use `pkg/errors.CodedError` for user-facing errors with error codes\n- **Naming**: CamelCase for exported, camelCase for unexported\n- **Testing**: Use `testify/require` for assertions; prefer table-driven tests\n\nExample import block:\n\n```go\nimport (\n    \"fmt\"\n\n    \"github.com/spf13/cobra\"\n\n    \"github.com/replicate/cog/pkg/config\"\n)\n```\n\n### Python\n\n- **Imports**: Automatically organized by ruff/isort (stdlib → third-party → local)\n- **Formatting**: Use `mise run fmt:python:fix`\n- **Linting**: Must pass ruff checks: E (pycodestyle), F (Pyflakes), I (isort), W (warnings), S (bandit), B (bugbear), ANN (annotations)\n- **Type Annotations**: Required on all function signatures; use `typing_extensions` for compatibility; avoid `Any` where possible\n- **Error Handling**: Raise exceptions with descriptive messages; avoid generic exception catching\n- **Naming**: snake_case for functions/variables/modules, PascalCase for classes\n- **Testing**: Use pytest with fixtures; async tests with pytest-asyncio\n- **Compatibility**: Must support Python 3.10-3.13\n\n### Rust\n\n- **Formatting**: Use `mise run fmt:rust:fix`\n- **Linting**: Must pass `mise run lint:rust` (clippy)\n- **Dependencies**: Audited with `cargo-deny` (see `crates/deny.toml`); run `mise run lint:rust:deny`\n- **Error Handling**: Use `thiserror` for typed errors, `anyhow` for application errors\n- **Naming**: snake_case for functions/variables, PascalCase for types\n- **Testing**: Use `cargo test`; snapshot tests use `insta`\n- **Async**: tokio runtime; async/await patterns\n\n## Working on the CLI and support tooling\n\nThe CLI code is in the `cmd/cog/` and `pkg/` directories. Support tooling is in the `tools/` directory.\n\nThe main commands for working on the CLI are:\n\n- `go run ./cmd/cog` - Runs the Cog CLI directly from source (requires wheel to be built first)\n- `mise run build:cog` - Builds the Cog CLI binary\n- `mise run install` - Symlinks the built binary to `/usr/local/bin` (run `build:cog` first), or to a custom path with `PREFIX=/custom/path mise run install`\n- `mise run test:go` - Runs all Go unit tests\n- `go test ./pkg/...` - Runs tests directly with `go test`\n\n## Working on the Python SDK\n\nThe Python SDK is developed in the `python/cog/` directory. It uses `uv` for virtual environments and `tox` for testing across multiple Python versions.\n\nThe main commands for working on the SDK are:\n\n- `mise run build:sdk` - Builds the Python wheel\n- `mise run test:python` - Runs Python tests across all supported versions\n\n## Working on Coglet (Rust)\n\nCoglet is the Rust-based prediction server that runs inside Cog containers, handling HTTP requests, worker process management, and prediction execution.\n\nThe code is in the `crates/` directory:\n\n- `crates/coglet/` - Core Rust library (HTTP server, worker orchestration, IPC)\n- `crates/coglet-python/` - PyO3 bindings for Python predictor integration (requires Python 3.10+)\n\nFor detailed architecture documentation, see `crates/README.md` and `crates/coglet/README.md`.\n\nThe main commands for working on Coglet are:\n\n- `mise run build:coglet` - Build and install coglet wheel for development (macOS, for local Rust/Python tests)\n- `mise run build:coglet:wheel:linux-x64` - Build Linux x86_64 wheel (required to test Rust changes in Docker containers via `cog predict`/`cog train`)\n- `mise run test:rust` - Run Rust unit tests\n- `mise run lint:rust` - Run clippy linter\n- `mise run fmt:rust:fix` - Format code\n\n### Testing\n\nGo code is tested using the built-in `go test` framework:\n\n- `go test ./pkg/... -run <name>` - Runs specific Go tests by name\n- `mise run test:go` - Runs all Go unit tests\n\nPython code is tested using `tox`, which allows testing across multiple Python versions and configurations:\n\n- `mise run test:python` - Runs all Python unit tests\n- `uv run tox -e py312-tests -- python/tests/server/test_http.py::test_openapi_specification_with_yield` - Runs a specific Python test\n\nThe integration test suite in `integration-tests/` tests the end-to-end functionality of the Cog CLI and Python SDK using Go's testscript framework:\n\n- `mise run test:integration` - Runs the integration tests\n- `mise run test:integration string_predictor` - Runs a specific integration test\n\nThe integration tests require a built Cog binary, which defaults to the first `cog` in `PATH`. Run tests against a specific binary with the `COG_BINARY` environment variable:\n\n```bash\nmise run build:cog\nCOG_BINARY=dist/go/*/cog mise run test:integration\n```\n\n### Development Workflow\n\n1. Run `mise install` to set up the development environment\n2. Run `mise run build:sdk` after making changes to the `./python` directory\n3. Run `mise run build:coglet:wheel:linux-x64` after making changes to the `./crates` directory (needed for Docker testing)\n4. Run `mise run build:cog` to build the CLI (wheels are picked up from `dist/` at Docker build time, not embedded in the binary)\n5. Run `mise run fmt:fix` to format code\n6. Run `mise run lint` to check code quality\n7. Run `mise run docs:llm` to regenerate `docs/llms.txt` after changing `README.md` or any `docs/*.md` file\n8. Read the `./docs` directory and make sure the documentation is up to date\n\n**IMPORTANT:** Always run `mise run lint` (or the language-specific variant, e.g. `mise run lint:go`) before committing to catch linter errors early. CI will reject PRs that fail lint checks.\n\n## Architecture\n\n### CLI Architecture (Go)\n\nThe CLI follows a command pattern with subcommands. The main components are:\n\n- `pkg/cli/` - Command definitions (build, exec, predict, serve, etc.)\n- `pkg/docker/` - Docker client and container management\n- `pkg/dockerfile/` - Dockerfile generation and templating\n- `pkg/config/` - cog.yaml parsing and validation\n- `pkg/image/` - Image building and pushing logic\n\n### Python SDK Architecture\n\n- `python/cog/` - Core SDK\n  - `base_predictor.py` - Base class for model predictors\n  - `types.py` - Input/output type definitions\n  - `server/` - HTTP/queue server implementation\n  - `command/` - Runner implementations for predict/train\n\n### Coglet Architecture (Rust)\n\nThe prediction server that runs inside Cog containers. Uses a two-process architecture: a parent process (HTTP server + orchestrator) and a worker subprocess (Python predictor execution).\n\nSee `crates/README.md` for detailed architecture documentation.\n\n- `crates/coglet/` - Core Rust library (HTTP server, worker orchestration, IPC bridge)\n- `crates/coglet-python/` - PyO3 bindings for Python predictor integration\n\n### Key Design Patterns\n\n1. **Local Wheel Resolution**: The CLI discovers SDK and coglet wheels from `dist/` at Docker build time (not embedded in the binary)\n2. **Docker SDK Integration**: Uses Docker Go SDK for container operations\n3. **Type Safety**: Dataclasses for Python type validation, strongly typed Go interfaces\n4. **Compatibility Matrix**: Automated CUDA/PyTorch/TensorFlow compatibility management\n\nFor comprehensive architecture documentation, see [`architecture/`](./architecture/00-overview.md).\n\n## Common Tasks\n\n### Adding a new CLI command\n\n1. Create command file in `pkg/cli/`\n2. Add command to `pkg/cli/root.go`\n3. Implement business logic in appropriate `pkg/` subdirectory\n4. Add tests\n\n### Modifying Python SDK behavior\n\n1. Edit files in `python/cog/`\n2. Run `mise run build:sdk` to rebuild wheel\n3. Test with `mise run test:python`\n4. Integration test with `mise run test:integration`\n\n### Updating ML framework compatibility\n\n1. See `tools/compatgen/` for compatibility matrix generation\n2. Update framework versions in relevant Dockerfile templates\n3. Test with various framework combinations\n\n### Updating the docs\n\n- Documentation is in the `docs/` directory, written in Markdown and generated into HTML using `mkdocs`.\n- **IMPORTANT:** After editing any file in `docs/` or `README.md`, you MUST run `mise run docs:llm` to regenerate `docs/llms.txt`. This file is used by coding agents and should be kept in sync with the documentation.\n- **IMPORTANT:** CLI reference docs (`docs/cli.md`) are auto-generated from Go source code. After modifying CLI commands in `cmd/` or `pkg/cli/`, run `mise run docs:cli` to regenerate, and ensure `mise run docs:cli:check` passes before committing.\n\n## CI Tool Dependencies\n\nDevelopment tools are managed in **one place**: **`mise.toml`**. CI workflows use\n`jdx/mise-action@v4` (with caching enabled) to install the same tool versions that\ndevelopers use locally. This eliminates version drift between local dev and CI.\n\n**Exceptions:**\n\n| Tool                       | CI method              | Why                                                                    |\n| -------------------------- | ---------------------- | ---------------------------------------------------------------------- |\n| coglet wheel (maturin+zig) | `PyO3/maturin-action`  | Builds inside a manylinux container with bundled maturin and zig       |\n| Rust target cache          | `Swatinem/rust-cache`  | Caches `crates/target/` directory (separate from tool caching)         |\n| `check-stubs` Python       | `actions/setup-python` | Needs shared-library Python (libpython3.x.so) for PyO3 auto-initialize |\n\n**When updating a tool version**, update `mise.toml` only. CI picks it up automatically.\n\n## Agent Skills\n\nThe `.agents/skills/` directory contains shared skill definitions that provide specialized instructions and workflows for coding agents. Each skill is a subdirectory with a `SKILL.md` file that agents load on demand when the task matches.\n\nSkills are invoked automatically by agents when a matching task is detected. See individual `SKILL.md` files for details on when and how each skill applies.\n\n## Important Files\n\n- `VERSION.txt` - Canonical version (single source of truth)\n- `cog.yaml` - User-facing model configuration\n- `pkg/config/config.go` - Go code for parsing and validating `cog.yaml`\n- `pkg/config/data/config_schema_v1.0.json` - JSON schema for `cog.yaml`\n- `python/cog/base_predictor.py` - Predictor interface\n- `crates/Cargo.toml` - Rust workspace configuration (version must match VERSION.txt)\n- `crates/README.md` - Coglet architecture overview\n- `mise.toml` - Task definitions for development workflow\n\n## Testing Philosophy\n\n- Unit tests for individual components (Go and Python)\n- Integration tests for end-to-end workflows\n- Tests use real Docker operations (no mocking Docker API)\n- Always run `mise run build:sdk` after making Python changes before testing Go code\n- Python 3.10-3.13 compatibility is required\n\n### Go Test Conventions\n\nAll Go tests must use [testify](https://github.com/stretchr/testify) for assertions. Do **not** use raw `if` checks with `t.Fatal`/`t.Errorf` — use `require` and `assert` instead.\n\n- **`require`** — for fatal assertions that should stop the test (setup failures, preconditions):\n  ```go\n  require.NoError(t, err, \"failed to create client\")\n  require.Equal(t, expected, actual)\n  require.True(t, condition, \"server should be ready\")\n  ```\n- **`assert`** — for non-fatal checks where the test should continue (e.g. validating multiple fields in a loop):\n  ```go\n  assert.Equal(t, http.StatusOK, resp.StatusCode)\n  assert.Contains(t, output, \"expected substring\")\n  assert.NoError(t, err, \"prediction %d failed\", i)\n  ```\n- Use `require` for errors in setup/teardown and `assert` for the actual test expectations\n- Prefer specific assertions (`Equal`, `Contains`, `NoError`, `Len`, `Less`) over generic `True`/`False` — they produce better failure messages\n- Prefer table-driven tests for testing multiple similar cases\n"},"files":{"AGENTS.md":"# AGENTS.md\n\nThis file provides guidance to coding agents when working with code in this repository.\n\n## Project Overview\n\nCog is a tool that packages machine learning models in production-ready containers.\n\nIt consists of:\n\n- **Cog CLI** (`cmd/cog/`) - Command-line interface for building, running, and deploying models, written in Go\n- **Python SDK** (`python/cog/`) - Python library for defining model predictors and training in Python\n- **Coglet** (`crates/`) - Rust-based prediction server that runs inside containers, with Python bindings via PyO3\n\nDocumentation for the CLI and SDK is available by reading ./docs/llms.txt.\n\n## Development Commands\n\nDevelopment tasks are managed with [mise](https://mise.jdx.dev/). Run `mise tasks` to see all available tasks.\n\n### Quick Reference\n\n| Task                          | Description                                                  |\n| ----------------------------- | ------------------------------------------------------------ |\n| `mise run fmt`                | Check formatting (all languages)                             |\n| `mise run fmt:fix`            | Fix formatting (all languages)                               |\n| `mise run lint`               | Run linters (all languages)                                  |\n| `mise run lint:fix`           | Fix lint issues (all languages)                              |\n| `mise run test:go`            | Run Go tests                                                 |\n| `mise run test:rust`          | Run Rust tests                                               |\n| `mise run test:python`        | Run Python tests                                             |\n| `mise run test:integration`   | Run integration tests                                        |\n| `mise run build:cog`          | Build cog CLI binary                                         |\n| `mise run build:coglet`       | Build coglet wheel (dev)                                     |\n| `mise run build:sdk`          | Build SDK wheel                                              |\n| `mise run install`            | Build and symlink cog to /usr/local/bin                      |\n| `mise run docs:llm`           | **IMPORTANT:** Regenerate `docs/llms.txt` after editing docs |\n| `mise run docs:cli`           | Generate CLI reference docs from Go source code              |\n| `mise run version`            | Show current version from VERSION.txt                        |\n| `mise run version:bump <ver>` | Bump version everywhere and commit                           |\n\n### Task Naming Convention\n\nTasks follow a consistent naming pattern:\n\n- **Language-based tasks** for fmt/lint/test/typecheck: `task:go`, `task:rust`, `task:python`\n- **Component-based tasks** for build: `build:cog`, `build:coglet`, `build:sdk`\n- **Check vs Fix**: `fmt` and `lint` default to check mode (non-destructive); use `:fix` suffix to auto-fix\n\n### All Tasks by Category\n\n**Format:**\n\n- `mise run fmt` / `mise run fmt:check` - Check all (alias)\n- `mise run fmt:fix` - Fix all\n- `mise run fmt:go` / `mise run fmt:rust` / `mise run fmt:python` - Per-language\n\n**Lint:**\n\n- `mise run lint` / `mise run lint:check` - Check all (alias)\n- `mise run lint:fix` - Fix all\n- `mise run lint:go` / `mise run lint:rust` / `mise run lint:python` - Per-language\n- `mise run lint:rust:deny` - Check Rust licenses/advisories\n\n**Test:**\n\n- `mise run test:go` - Go unit tests\n- `mise run test:rust` - Rust unit tests\n- `mise run test:python` - Python unit tests (via tox)\n- `mise run test:coglet:python` - Coglet Python binding tests\n- `mise run test:integration` - Integration tests\n\n**Build:**\n\n- `mise run build:cog` - Build cog CLI (development)\n- `mise run build:cog:release` - Build cog CLI (release)\n- `mise run build:coglet` - Build coglet wheel (dev install)\n- `mise run build:coglet:wheel` - Build coglet wheel (native platform)\n- `mise run build:coglet:wheel:linux-x64` - Build for Linux x86_64\n- `mise run build:coglet:wheel:linux-arm64` - Build for Linux ARM64\n- `mise run build:sdk` - Build SDK wheel\n\n**Install:**\n\n- `mise run install` - Symlink cog CLI to `/usr/local/bin` (requires `build:cog` first)\n- `PREFIX=/custom/path mise run install` - Symlink to custom location\n\n**Version:**\n\n- `mise run version` - Show current version from VERSION.txt\n- `mise run version:bump <ver>` - Bump version everywhere and commit\n- `mise run version:check` - Verify VERSION.txt matches Cargo.toml\n\n**Other:**\n\n- `mise run typecheck` - Type check all languages\n- `mise run generate` - Run code generation\n- `mise run clean` - Clean all build artifacts\n- `mise run docs` - Build documentation\n- `mise run docs:serve` - Serve docs locally\n\n## Code Style Guidelines\n\n### Go\n\n- **Imports**: Organize in three groups separated by blank lines: (1) Standard library, (2) Third-party packages, (3) Internal packages (`github.com/replicate/cog/pkg/...`)\n- **Formatting**: Use `mise run fmt:go:fix`\n- **Linting**: Must pass golangci-lint with: errcheck, gocritic, gosec, govet, ineffassign, misspell, revive, staticcheck, unused\n- **Error Handling**: Return errors as values; use `pkg/errors.CodedError` for user-facing errors with error codes\n- **Naming**: CamelCase for exported, camelCase for unexported\n- **Testing**: Use `testify/require` for assertions; prefer table-driven tests\n\nExample import block:\n\n```go\nimport (\n    \"fmt\"\n\n    \"github.com/spf13/cobra\"\n\n    \"github.com/replicate/cog/pkg/config\"\n)\n```\n\n### Python\n\n- **Imports**: Automatically organized by ruff/isort (stdlib → third-party → local)\n- **Formatting**: Use `mise run fmt:python:fix`\n- **Linting**: Must pass ruff checks: E (pycodestyle), F (Pyflakes), I (isort), W (warnings), S (bandit), B (bugbear), ANN (annotations)\n- **Type Annotations**: Required on all function signatures; use `typing_extensions` for compatibility; avoid `Any` where possible\n- **Error Handling**: Raise exceptions with descriptive messages; avoid generic exception catching\n- **Naming**: snake_case for functions/variables/modules, PascalCase for classes\n- **Testing**: Use pytest with fixtures; async tests with pytest-asyncio\n- **Compatibility**: Must support Python 3.10-3.13\n\n### Rust\n\n- **Formatting**: Use `mise run fmt:rust:fix`\n- **Linting**: Must pass `mise run lint:rust` (clippy)\n- **Dependencies**: Audited with `cargo-deny` (see `crates/deny.toml`); run `mise run lint:rust:deny`\n- **Error Handling**: Use `thiserror` for typed errors, `anyhow` for application errors\n- **Naming**: snake_case for functions/variables, PascalCase for types\n- **Testing**: Use `cargo test`; snapshot tests use `insta`\n- **Async**: tokio runtime; async/await patterns\n\n## Working on the CLI and support tooling\n\nThe CLI code is in the `cmd/cog/` and `pkg/` directories. Support tooling is in the `tools/` directory.\n\nThe main commands for working on the CLI are:\n\n- `go run ./cmd/cog` - Runs the Cog CLI directly from source (requires wheel to be built first)\n- `mise run build:cog` - Builds the Cog CLI binary\n- `mise run install` - Symlinks the built binary to `/usr/local/bin` (run `build:cog` first), or to a custom path with `PREFIX=/custom/path mise run install`\n- `mise run test:go` - Runs all Go unit tests\n- `go test ./pkg/...` - Runs tests directly with `go test`\n\n## Working on the Python SDK\n\nThe Python SDK is developed in the `python/cog/` directory. It uses `uv` for virtual environments and `tox` for testing across multiple Python versions.\n\nThe main commands for working on the SDK are:\n\n- `mise run build:sdk` - Builds the Python wheel\n- `mise run test:python` - Runs Python tests across all supported versions\n\n## Working on Coglet (Rust)\n\nCoglet is the Rust-based prediction server that runs inside Cog containers, handling HTTP requests, worker process management, and prediction execution.\n\nThe code is in the `crates/` directory:\n\n- `crates/coglet/` - Core Rust library (HTTP server, worker orchestration, IPC)\n- `crates/coglet-python/` - PyO3 bindings for Python predictor integration (requires Python 3.10+)\n\nFor detailed architecture documentation, see `crates/README.md` and `crates/coglet/README.md`.\n\nThe main commands for working on Coglet are:\n\n- `mise run build:coglet` - Build and install coglet wheel for development (macOS, for local Rust/Python tests)\n- `mise run build:coglet:wheel:linux-x64` - Build Linux x86_64 wheel (required to test Rust changes in Docker containers via `cog predict`/`cog train`)\n- `mise run test:rust` - Run Rust unit tests\n- `mise run lint:rust` - Run clippy linter\n- `mise run fmt:rust:fix` - Format code\n\n### Testing\n\nGo code is tested using the built-in `go test` framework:\n\n- `go test ./pkg/... -run <name>` - Runs specific Go tests by name\n- `mise run test:go` - Runs all Go unit tests\n\nPython code is tested using `tox`, which allows testing across multiple Python versions and configurations:\n\n- `mise run test:python` - Runs all Python unit tests\n- `uv run tox -e py312-tests -- python/tests/server/test_http.py::test_openapi_specification_with_yield` - Runs a specific Python test\n\nThe integration test suite in `integration-tests/` tests the end-to-end functionality of the Cog CLI and Python SDK using Go's testscript framework:\n\n- `mise run test:integration` - Runs the integration tests\n- `mise run test:integration string_predictor` - Runs a specific integration test\n\nThe integration tests require a built Cog binary, which defaults to the first `cog` in `PATH`. Run tests against a specific binary with the `COG_BINARY` environment variable:\n\n```bash\nmise run build:cog\nCOG_BINARY=dist/go/*/cog mise run test:integration\n```\n\n### Development Workflow\n\n1. Run `mise install` to set up the development environment\n2. Run `mise run build:sdk` after making changes to the `./python` directory\n3. Run `mise run build:coglet:wheel:linux-x64` after making changes to the `./crates` directory (needed for Docker testing)\n4. Run `mise run build:cog` to build the CLI (wheels are picked up from `dist/` at Docker build time, not embedded in the binary)\n5. Run `mise run fmt:fix` to format code\n6. Run `mise run lint` to check code quality\n7. Run `mise run docs:llm` to regenerate `docs/llms.txt` after changing `README.md` or any `docs/*.md` file\n8. Read the `./docs` directory and make sure the documentation is up to date\n\n**IMPORTANT:** Always run `mise run lint` (or the language-specific variant, e.g. `mise run lint:go`) before committing to catch linter errors early. CI will reject PRs that fail lint checks.\n\n## Architecture\n\n### CLI Architecture (Go)\n\nThe CLI follows a command pattern with subcommands. The main components are:\n\n- `pkg/cli/` - Command definitions (build, exec, predict, serve, etc.)\n- `pkg/docker/` - Docker client and container management\n- `pkg/dockerfile/` - Dockerfile generation and templating\n- `pkg/config/` - cog.yaml parsing and validation\n- `pkg/image/` - Image building and pushing logic\n\n### Python SDK Architecture\n\n- `python/cog/` - Core SDK\n  - `base_predictor.py` - Base class for model predictors\n  - `types.py` - Input/output type definitions\n  - `server/` - HTTP/queue server implementation\n  - `command/` - Runner implementations for predict/train\n\n### Coglet Architecture (Rust)\n\nThe prediction server that runs inside Cog containers. Uses a two-process architecture: a parent process (HTTP server + orchestrator) and a worker subprocess (Python predictor execution).\n\nSee `crates/README.md` for detailed architecture documentation.\n\n- `crates/coglet/` - Core Rust library (HTTP server, worker orchestration, IPC bridge)\n- `crates/coglet-python/` - PyO3 bindings for Python predictor integration\n\n### Key Design Patterns\n\n1. **Local Wheel Resolution**: The CLI discovers SDK and coglet wheels from `dist/` at Docker build time (not embedded in the binary)\n2. **Docker SDK Integration**: Uses Docker Go SDK for container operations\n3. **Type Safety**: Dataclasses for Python type validation, strongly typed Go interfaces\n4. **Compatibility Matrix**: Automated CUDA/PyTorch/TensorFlow compatibility management\n\nFor comprehensive architecture documentation, see [`architecture/`](./architecture/00-overview.md).\n\n## Common Tasks\n\n### Adding a new CLI command\n\n1. Create command file in `pkg/cli/`\n2. Add command to `pkg/cli/root.go`\n3. Implement business logic in appropriate `pkg/` subdirectory\n4. Add tests\n\n### Modifying Python SDK behavior\n\n1. Edit files in `python/cog/`\n2. Run `mise run build:sdk` to rebuild wheel\n3. Test with `mise run test:python`\n4. Integration test with `mise run test:integration`\n\n### Updating ML framework compatibility\n\n1. See `tools/compatgen/` for compatibility matrix generation\n2. Update framework versions in relevant Dockerfile templates\n3. Test with various framework combinations\n\n### Updating the docs\n\n- Documentation is in the `docs/` directory, written in Markdown and generated into HTML using `mkdocs`.\n- **IMPORTANT:** After editing any file in `docs/` or `README.md`, you MUST run `mise run docs:llm` to regenerate `docs/llms.txt`. This file is used by coding agents and should be kept in sync with the documentation.\n- **IMPORTANT:** CLI reference docs (`docs/cli.md`) are auto-generated from Go source code. After modifying CLI commands in `cmd/` or `pkg/cli/`, run `mise run docs:cli` to regenerate, and ensure `mise run docs:cli:check` passes before committing.\n\n## CI Tool Dependencies\n\nDevelopment tools are managed in **one place**: **`mise.toml`**. CI workflows use\n`jdx/mise-action@v4` (with caching enabled) to install the same tool versions that\ndevelopers use locally. This eliminates version drift between local dev and CI.\n\n**Exceptions:**\n\n| Tool                       | CI method              | Why                                                                    |\n| -------------------------- | ---------------------- | ---------------------------------------------------------------------- |\n| coglet wheel (maturin+zig) | `PyO3/maturin-action`  | Builds inside a manylinux container with bundled maturin and zig       |\n| Rust target cache          | `Swatinem/rust-cache`  | Caches `crates/target/` directory (separate from tool caching)         |\n| `check-stubs` Python       | `actions/setup-python` | Needs shared-library Python (libpython3.x.so) for PyO3 auto-initialize |\n\n**When updating a tool version**, update `mise.toml` only. CI picks it up automatically.\n\n## Agent Skills\n\nThe `.agents/skills/` directory contains shared skill definitions that provide specialized instructions and workflows for coding agents. Each skill is a subdirectory with a `SKILL.md` file that agents load on demand when the task matches.\n\nSkills are invoked automatically by agents when a matching task is detected. See individual `SKILL.md` files for details on when and how each skill applies.\n\n## Important Files\n\n- `VERSION.txt` - Canonical version (single source of truth)\n- `cog.yaml` - User-facing model configuration\n- `pkg/config/config.go` - Go code for parsing and validating `cog.yaml`\n- `pkg/config/data/config_schema_v1.0.json` - JSON schema for `cog.yaml`\n- `python/cog/base_predictor.py` - Predictor interface\n- `crates/Cargo.toml` - Rust workspace configuration (version must match VERSION.txt)\n- `crates/README.md` - Coglet architecture overview\n- `mise.toml` - Task definitions for development workflow\n\n## Testing Philosophy\n\n- Unit tests for individual components (Go and Python)\n- Integration tests for end-to-end workflows\n- Tests use real Docker operations (no mocking Docker API)\n- Always run `mise run build:sdk` after making Python changes before testing Go code\n- Python 3.10-3.13 compatibility is required\n\n### Go Test Conventions\n\nAll Go tests must use [testify](https://github.com/stretchr/testify) for assertions. Do **not** use raw `if` checks with `t.Fatal`/`t.Errorf` — use `require` and `assert` instead.\n\n- **`require`** — for fatal assertions that should stop the test (setup failures, preconditions):\n  ```go\n  require.NoError(t, err, \"failed to create client\")\n  require.Equal(t, expected, actual)\n  require.True(t, condition, \"server should be ready\")\n  ```\n- **`assert`** — for non-fatal checks where the test should continue (e.g. validating multiple fields in a loop):\n  ```go\n  assert.Equal(t, http.StatusOK, resp.StatusCode)\n  assert.Contains(t, output, \"expected substring\")\n  assert.NoError(t, err, \"prediction %d failed\", i)\n  ```\n- Use `require` for errors in setup/teardown and `assert` for the actual test expectations\n- Prefer specific assertions (`Equal`, `Contains`, `NoError`, `Len`, `Less`) over generic `True`/`False` — they produce better failure messages\n- Prefer table-driven tests for testing multiple similar cases\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# AGENTS.md\n\nThis file provides guidance to coding agents when working with code in this repository.\n\n## Project Overview\n\nCog is a tool that packages machine learning models in production-ready containers.\n\nIt consists of:\n\n- **Cog CLI** (`cmd/cog/`) - Command-line interface for building, running, and deploying models, written in Go\n- **Python SDK** (`python/cog/`) - Python library for defining model predictors and training in Python\n- **Coglet** (`crates/`) - Rust-based prediction server that runs inside containers, with Python bindings via PyO3\n\nDocumentation for the CLI and SDK is available by reading ./docs/llms.txt.\n\n## Development Commands\n\nDevelopment tasks are managed with [mise](https://mise.jdx.dev/). Run `mise tasks` to see all available tasks.\n\n### Quick Reference\n\n| Task                          | Description                                                  |\n| ----------------------------- | ------------------------------------------------------------ |\n| `mise run fmt`                | Check formatting (all languages)                             |\n| `mise run fmt:fix`            | Fix formatting (all languages)                               |\n| `mise run lint`               | Run linters (all languages)                                  |\n| `mise run lint:fix`           | Fix lint issues (all languages)                              |\n| `mise run test:go`            | Run Go tests                                                 |\n| `mise run test:rust`          | Run Rust tests                                               |\n| `mise run test:python`        | Run Python tests                                             |\n| `mise run test:integration`   | Run integration tests                                        |\n| `mise run build:cog`          | Build cog CLI binary                                         |\n| `mise run build:coglet`       | Build coglet wheel (dev)                                     |\n| `mise run build:sdk`          | Build SDK wheel                                              |\n| `mise run install`            | Build and symlink cog to /usr/local/bin                      |\n| `mise run docs:llm`           | **IMPORTANT:** Regenerate `docs/llms.txt` after editing docs |\n| `mise run docs:cli`           | Generate CLI reference docs from Go source code              |\n| `mise run version`            | Show current version from VERSION.txt                        |\n| `mise run version:bump <ver>` | Bump version everywhere and commit                           |\n\n### Task Naming Convention\n\nTasks follow a consistent naming pattern:\n\n- **Language-based tasks** for fmt/lint/test/typecheck: `task:go`, `task:rust`, `task:python`\n- **Component-based tasks** for build: `build:cog`, `build:coglet`, `build:sdk`\n- **Check vs Fix**: `fmt` and `lint` default to check mode (non-destructive); use `:fix` suffix to auto-fix\n\n### All Tasks by Category\n\n**Format:**\n\n- `mise run fmt` / `mise run fmt:check` - Check all (alias)\n- `mise run fmt:fix` - Fix all\n- `mise run fmt:go` / `mise run fmt:rust` / `mise run fmt:python` - Per-language\n\n**Lint:**\n\n- `mise run lint` / `mise run lint:check` - Check all (alias)\n- `mise run lint:fix` - Fix all\n- `mise run lint:go` / `mise run lint:rust` / `mise run lint:python` - Per-language\n- `mise run lint:rust:deny` - Check Rust licenses/advisories\n\n**Test:**\n\n- `mise run test:go` - Go unit tests\n- `mise run test:rust` - Rust unit tests\n- `mise run test:python` - Python unit tests (via tox)\n- `mise run test:coglet:python` - Coglet Python binding tests\n- `mise run test:integration` - Integration tests\n\n**Build:**\n\n- `mise run build:cog` - Build cog CLI (development)\n- `mise run build:cog:release` - Build cog CLI (release)\n- `mise run build:coglet` - Build coglet wheel (dev install)\n- `mise run build:coglet:wheel` - Build coglet wheel (native platform)\n- `mise run build:coglet:wheel:linux-x64` - Build for Linux x86_64\n- `mise run build:coglet:wheel:linux-arm64` - Build for Linux ARM64\n- `mise run build:sdk` - Build SDK wheel\n\n**Install:**\n\n- `mise run install` - Symlink cog CLI to `/usr/local/bin` (requires `build:cog` first)\n- `PREFIX=/custom/path mise run install` - Symlink to custom location\n\n**Version:**\n\n- `mise run version` - Show current version from VERSION.txt\n- `mise run version:bump <ver>` - Bump version everywhere and commit\n- `mise run version:check` - Verify VERSION.txt matches Cargo.toml\n\n**Other:**\n\n- `mise run typecheck` - Type check all languages\n- `mise run generate` - Run code generation\n- `mise run clean` - Clean all build artifacts\n- `mise run docs` - Build documentation\n- `mise run docs:serve` - Serve docs locally\n\n## Code Style Guidelines\n\n### Go\n\n- **Imports**: Organize in three groups separated by blank lines: (1) Standard library, (2) Third-party packages, (3) Internal packages (`github.com/replicate/cog/pkg/...`)\n- **Formatting**: Use `mise run fmt:go:fix`\n- **Linting**: Must pass golangci-lint with: errcheck, gocritic, gosec, govet, ineffassign, misspell, revive, staticcheck, unused\n- **Error Handling**: Return errors as values; use `pkg/errors.CodedError` for user-facing errors with error codes\n- **Naming**: CamelCase for exported, camelCase for unexported\n- **Testing**: Use `testify/require` for assertions; prefer table-driven tests\n\nExample import block:\n\n```go\nimport (\n    \"fmt\"\n\n    \"github.com/spf13/cobra\"\n\n    \"github.com/replicate/cog/pkg/config\"\n)\n```\n\n### Python\n\n- **Imports**: Automatically organized by ruff/isort (stdlib → third-party → local)\n- **Formatting**: Use `mise run fmt:python:fix`\n- **Linting**: Must pass ruff checks: E (pycodestyle), F (Pyflakes), I (isort), W (warnings), S (bandit), B (bugbear), ANN (annotations)\n- **Type Annotations**: Required on all function signatures; use `typing_extensions` for compatibility; avoid `Any` where possible\n- **Error Handling**: Raise exceptions with descriptive messages; avoid generic exception catching\n- **Naming**: snake_case for functions/variables/modules, PascalCase for classes\n- **Testing**: Use pytest with fixtures; async tests with pytest-asyncio\n- **Compatibility**: Must support Python 3.10-3.13\n\n### Rust\n\n- **Formatting**: Use `mise run fmt:rust:fix`\n- **Linting**: Must pass `mise run lint:rust` (clippy)\n- **Dependencies**: Audited with `cargo-deny` (see `crates/deny.toml`); run `mise run lint:rust:deny`\n- **Error Handling**: Use `thiserror` for typed errors, `anyhow` for application errors\n- **Naming**: snake_case for functions/variables, PascalCase for types\n- **Testing**: Use `cargo test`; snapshot tests use `insta`\n- **Async**: tokio runtime; async/await patterns\n\n## Working on the CLI and support tooling\n\nThe CLI code is in the `cmd/cog/` and `pkg/` directories. Support tooling is in the `tools/` directory.\n\nThe main commands for working on the CLI are:\n\n- `go run ./cmd/cog` - Runs the Cog CLI directly from source (requires wheel to be built first)\n- `mise run build:cog` - Builds the Cog CLI binary\n- `mise run install` - Symlinks the built binary to `/usr/local/bin` (run `build:cog` first), or to a custom path with `PREFIX=/custom/path mise run install`\n- `mise run test:go` - Runs all Go unit tests\n- `go test ./pkg/...` - Runs tests directly with `go test`\n\n## Working on the Python SDK\n\nThe Python SDK is developed in the `python/cog/` directory. It uses `uv` for virtual environments and `tox` for testing across multiple Python versions.\n\nThe main commands for working on the SDK are:\n\n- `mise run build:sdk` - Builds the Python wheel\n- `mise run test:python` - Runs Python tests across all supported versions\n\n## Working on Coglet (Rust)\n\nCoglet is the Rust-based prediction server that runs inside Cog containers, handling HTTP requests, worker process management, and prediction execution.\n\nThe code is in the `crates/` directory:\n\n- `crates/coglet/` - Core Rust library (HTTP server, worker orchestration, IPC)\n- `crates/coglet-python/` - PyO3 bindings for Python predictor integration (requires Python 3.10+)\n\nFor detailed architecture documentation, see `crates/README.md` and `crates/coglet/README.md`.\n\nThe main commands for working on Coglet are:\n\n- `mise run build:coglet` - Build and install coglet wheel for development (macOS, for local Rust/Python tests)\n- `mise run build:coglet:wheel:linux-x64` - Build Linux x86_64 wheel (required to test Rust changes in Docker containers via `cog predict`/`cog train`)\n- `mise run test:rust` - Run Rust unit tests\n- `mise run lint:rust` - Run clippy linter\n- `mise run fmt:rust:fix` - Format code\n\n### Testing\n\nGo code is tested using the built-in `go test` framework:\n\n- `go test ./pkg/... -run <name>` - Runs specific Go tests by name\n- `mise run test:go` - Runs all Go unit tests\n\nPython code is tested using `tox`, which allows testing across multiple Python versions and configurations:\n\n- `mise run test:python` - Runs all Python unit tests\n- `uv run tox -e py312-tests -- python/tests/server/test_http.py::test_openapi_specification_with_yield` - Runs a specific Python test\n\nThe integration test suite in `integration-tests/` tests the end-to-end functionality of the Cog CLI and Python SDK using Go's testscript framework:\n\n- `mise run test:integration` - Runs the integration tests\n- `mise run test:integration string_predictor` - Runs a specific integration test\n\nThe integration tests require a built Cog binary, which defaults to the first `cog` in `PATH`. Run tests against a specific binary with the `COG_BINARY` environment variable:\n\n```bash\nmise run build:cog\nCOG_BINARY=dist/go/*/cog mise run test:integration\n```\n\n### Development Workflow\n\n1. Run `mise install` to set up the development environment\n2. Run `mise run build:sdk` after making changes to the `./python` directory\n3. Run `mise run build:coglet:wheel:linux-x64` after making changes to the `./crates` directory (needed for Docker testing)\n4. Run `mise run build:cog` to build the CLI (wheels are picked up from `dist/` at Docker build time, not embedded in the binary)\n5. Run `mise run fmt:fix` to format code\n6. Run `mise run lint` to check code quality\n7. Run `mise run docs:llm` to regenerate `docs/llms.txt` after changing `README.md` or any `docs/*.md` file\n8. Read the `./docs` directory and make sure the documentation is up to date\n\n**IMPORTANT:** Always run `mise run lint` (or the language-specific variant, e.g. `mise run lint:go`) before committing to catch linter errors early. CI will reject PRs that fail lint checks.\n\n## Architecture\n\n### CLI Architecture (Go)\n\nThe CLI follows a command pattern with subcommands. The main components are:\n\n- `pkg/cli/` - Command definitions (build, exec, predict, serve, etc.)\n- `pkg/docker/` - Docker client and container management\n- `pkg/dockerfile/` - Dockerfile generation and templating\n- `pkg/config/` - cog.yaml parsing and validation\n- `pkg/image/` - Image building and pushing logic\n\n### Python SDK Architecture\n\n- `python/cog/` - Core SDK\n  - `base_predictor.py` - Base class for model predictors\n  - `types.py` - Input/output type definitions\n  - `server/` - HTTP/queue server implementation\n  - `command/` - Runner implementations for predict/train\n\n### Coglet Architecture (Rust)\n\nThe prediction server that runs inside Cog containers. Uses a two-process architecture: a parent process (HTTP server + orchestrator) and a worker subprocess (Python predictor execution).\n\nSee `crates/README.md` for detailed architecture documentation.\n\n- `crates/coglet/` - Core Rust library (HTTP server, worker orchestration, IPC bridge)\n- `crates/coglet-python/` - PyO3 bindings for Python predictor integration\n\n### Key Design Patterns\n\n1. **Local Wheel Resolution**: The CLI discovers SDK and coglet wheels from `dist/` at Docker build time (not embedded in the binary)\n2. **Docker SDK Integration**: Uses Docker Go SDK for container operations\n3. **Type Safety**: Dataclasses for Python type validation, strongly typed Go interfaces\n4. **Compatibility Matrix**: Automated CUDA/PyTorch/TensorFlow compatibility management\n\nFor comprehensive architecture documentation, see [`architecture/`](./architecture/00-overview.md).\n\n## Common Tasks\n\n### Adding a new CLI command\n\n1. Create command file in `pkg/cli/`\n2. Add command to `pkg/cli/root.go`\n3. Implement business logic in appropriate `pkg/` subdirectory\n4. Add tests\n\n### Modifying Python SDK behavior\n\n1. Edit files in `python/cog/`\n2. Run `mise run build:sdk` to rebuild wheel\n3. Test with `mise run test:python`\n4. Integration test with `mise run test:integration`\n\n### Updating ML framework compatibility\n\n1. See `tools/compatgen/` for compatibility matrix generation\n2. Update framework versions in relevant Dockerfile templates\n3. Test with various framework combinations\n\n### Updating the docs\n\n- Documentation is in the `docs/` directory, written in Markdown and generated into HTML using `mkdocs`.\n- **IMPORTANT:** After editing any file in `docs/` or `README.md`, you MUST run `mise run docs:llm` to regenerate `docs/llms.txt`. This file is used by coding agents and should be kept in sync with the documentation.\n- **IMPORTANT:** CLI reference docs (`docs/cli.md`) are auto-generated from Go source code. After modifying CLI commands in `cmd/` or `pkg/cli/`, run `mise run docs:cli` to regenerate, and ensure `mise run docs:cli:check` passes before committing.\n\n## CI Tool Dependencies\n\nDevelopment tools are managed in **one place**: **`mise.toml`**. CI workflows use\n`jdx/mise-action@v4` (with caching enabled) to install the same tool versions that\ndevelopers use locally. This eliminates version drift between local dev and CI.\n\n**Exceptions:**\n\n| Tool                       | CI method              | Why                                                                    |\n| -------------------------- | ---------------------- | ---------------------------------------------------------------------- |\n| coglet wheel (maturin+zig) | `PyO3/maturin-action`  | Builds inside a manylinux container with bundled maturin and zig       |\n| Rust target cache          | `Swatinem/rust-cache`  | Caches `crates/target/` directory (separate from tool caching)         |\n| `check-stubs` Python       | `actions/setup-python` | Needs shared-library Python (libpython3.x.so) for PyO3 auto-initialize |\n\n**When updating a tool version**, update `mise.toml` only. CI picks it up automatically.\n\n## Agent Skills\n\nThe `.agents/skills/` directory contains shared skill definitions that provide specialized instructions and workflows for coding agents. Each skill is a subdirectory with a `SKILL.md` file that agents load on demand when the task matches.\n\nSkills are invoked automatically by agents when a matching task is detected. See individual `SKILL.md` files for details on when and how each skill applies.\n\n## Important Files\n\n- `VERSION.txt` - Canonical version (single source of truth)\n- `cog.yaml` - User-facing model configuration\n- `pkg/config/config.go` - Go code for parsing and validating `cog.yaml`\n- `pkg/config/data/config_schema_v1.0.json` - JSON schema for `cog.yaml`\n- `python/cog/base_predictor.py` - Predictor interface\n- `crates/Cargo.toml` - Rust workspace configuration (version must match VERSION.txt)\n- `crates/README.md` - Coglet architecture overview\n- `mise.toml` - Task definitions for development workflow\n\n## Testing Philosophy\n\n- Unit tests for individual components (Go and Python)\n- Integration tests for end-to-end workflows\n- Tests use real Docker operations (no mocking Docker API)\n- Always run `mise run build:sdk` after making Python changes before testing Go code\n- Python 3.10-3.13 compatibility is required\n\n### Go Test Conventions\n\nAll Go tests must use [testify](https://github.com/stretchr/testify) for assertions. Do **not** use raw `if` checks with `t.Fatal`/`t.Errorf` — use `require` and `assert` instead.\n\n- **`require`** — for fatal assertions that should stop the test (setup failures, preconditions):\n  ```go\n  require.NoError(t, err, \"failed to create client\")\n  require.Equal(t, expected, actual)\n  require.True(t, condition, \"server should be ready\")\n  ```\n- **`assert`** — for non-fatal checks where the test should continue (e.g. validating multiple fields in a loop):\n  ```go\n  assert.Equal(t, http.StatusOK, resp.StatusCode)\n  assert.Contains(t, output, \"expected substring\")\n  assert.NoError(t, err, \"prediction %d failed\", i)\n  ```\n- Use `require` for errors in setup/teardown and `assert` for the actual test expectations\n- Prefer specific assertions (`Equal`, `Contains`, `NoError`, `Len`, `Less`) over generic `True`/`False` — they produce better failure messages\n- Prefer table-driven tests for testing multiple similar cases\n","category":"root","tokens":4154}]}