Skip to main content

Metis

A Python library and CLI for issue triage powered by TypeSafe AI's Jev model, with a reusable GitHub Action for automatic labeling and follow-up replies. Python 3.10+, no runtime dependencies.

Python package

Distribution name: metis-triage. Import name: metis_triage. The initial PyPI release is pending; installation from this checkout is available with python -m pip install .. After publication:

pip install metis-triage

Set TYPESAFE_API_KEY in your environment, then use the library:

from metis_triage import classify_issue

result = classify_issue(
    title="App crashes when exporting a report",
    body="Clicking Export closes the app. Expected a PDF download.",
    repository="owner/repo",
)

print(result.category)
print(result.suggested_label)
print(result.needs_review)
print(result.missing_details)

classify_issue calls TypeSafe and returns a TriageResult. It makes no GitHub requests and never posts comments or applies labels. You can also pass api_key, model, and a complete config dictionary from load_config() or load_config("path/to/config.json"). With the library API, suggested labels are recommendations; the caller checks whether they exist before applying them.

The CLI prints the result as JSON:

metis-triage classify --title "Export crashes" --body-file issue.md

python -m metis_triage supports the same commands. metis-triage github runs the GitHub integration using GITHUB_EVENT_PATH, GITHUB_EVENT_NAME, GITHUB_REPOSITORY, GITHUB_TOKEN, and TYPESAFE_API_KEY from the environment. That command may apply labels and post a comment, using the same rules as the Action.

GitHub Action setup

  1. Add the workflow below as .github/workflows/metis.yml on your repository's default branch. No script copying or checkout is needed for the default setup.
  2. In Settings → Secrets and variables → Actions, add the repository secret TYPESAFE_API_KEY. GitHub supplies GITHUB_TOKEN automatically.
  3. Make sure the repository has the bug, enhancement, documentation, and question labels, or provide a custom configuration as described below.
  4. Once you are ready to run it, open an issue. Check Actions → Metis issue triage for the result. Existing issues and comments do not trigger it.
name: Metis issue triage
on:
  issues:
    types: [opened]

permissions:
  issues: write

concurrency:
  group: metis-${{ github.repository }}-${{ github.event.issue.number }}
  cancel-in-progress: false

jobs:
  triage:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - uses: Ayush0054/metis@main
        with:
          typesafe-api-key: ${{ secrets.TYPESAFE_API_KEY }}

main is the initial development version; pin a commit SHA for reproducible use. The action requires Bash and Python 3.10+, available on GitHub-hosted Ubuntu runners.

The workflow requests issues: write. Organization policies must permit those permissions. Issue titles and descriptions are sent to TypeSafe for classification. Store the API key only in GitHub Secrets or your local ignored environment file.

Behavior

  • Classifies the primary issue purpose as bug, feature, documentation, question, or other.
  • Applies the corresponding existing label when both confidence thresholds pass.
  • Leaves unrelated labels intact and defers to conflicting existing category labels.
  • For clear bug reports, checks reproduction steps, expected/actual behavior, and relevant environment details in the same TypeSafe request.
  • Posts a fixed template listing only details judged missing. Jev selects typed decisions; it does not generate the reply text.
  • Skips uncertain classifications, bot-authored issues, closed issues, and oversized reports. Skips writes if the issue title or body changed during classification.
  • Avoids duplicate bot replies on reruns and avoids asking for information once a person has already commented. Reapplying the same label is unnecessary and skipped.
  • Fails the workflow on API errors or invalid responses. It never executes issue text, creates labels, assigns people, closes issues, or changes code.

Configuration

Copy the default configuration to your repository to change label names, disable missing-detail comments, or adjust thresholds. Add a checkout step before Metis, grant contents: read alongside issues: write, and pass config-path: .github/metis.json. The entire configuration file is required.

Defaults are 0.8 for Choice confidence, 0.85 for the selected category's probability, and 0.9 for each missing-detail probability. These are initial policy settings, not evaluated accuracy guarantees; tune them on your own issues when you are ready to test.

Set the action's model input to pin a model. The default is jev-latest. The optional github-token input defaults to GitHub's automatic token. Local .envrc and .env files are not loaded by the workflow.

An HTTP error during a write can leave a label applied without a reply. Rerun the failed job after resolving the error; it checks current labels and previous bot comments. Edits to the issue body do not automatically retrigger triage.

Implementation references

Publishing to PyPI

The package version is in pyproject.toml. The initial version is 0.1.0. The .github/workflows/publish.yml workflow builds the wheel and source distribution, then publishes them using PyPI Trusted Publishing. No PyPI API token is needed.

Create a pending publisher in PyPI with these exact values:

Field Value
PyPI Project Name metis-triage
Owner Ayush0054
Repository name metis
Workflow name publish.yml
Environment name pypi

Use a GitHub environment named pypi in the repository settings. After configuring the publisher and completing your desired validation, publish a GitHub release with tag v0.1.0 to trigger the first upload, or manually run Publish to PyPI on main. Later releases need a new package version and matching tag. Merely pushing commits does not run the publishing workflow.

The package has not been built, installed, or tested yet. No release has been triggered.

License

MIT © 2026 Ayush Jha.

Metadata

Release files for metis-triage 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metis-triage 0.1.0
File Size Uploaded Provenance Actions
metis_triage-0.1.0.tar.gz 9.9 kB With provenance Details for metis_triage-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metis-triage 0.1.0
File Interpreter ABI Platform Actions
metis_triage-0.1.0-py3-none-any.whl Python 3 none any Details for metis_triage-0.1.0-py3-none-any.whl

Total release size: 22.3 kB

Release files / metis_triage-0.1.0.tar.gz

Download URL metis_triage-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
459c573860ec55c8083dd30b25d0cad0a8505c0a799a4eb56e20b606ec339cb7
BLAKE2b-256 checksum
How to use checksums
d9f7162a8d213690a03d1cfdce57f5eb36265a92fae9796236fd4ec24253a825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / metis_triage-0.1.0-py3-none-any.whl

Download URL metis_triage-0.1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87220bfd7eea807690ca39e19211eab16ddffb382117fc21307c330fb7c15c51
BLAKE2b-256 checksum
How to use checksums
923e2c892330870112dad6418c14a9f62b21ec88dd54e3713e2c733b29fef384
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Security for metis-triage 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for metis_triage-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page