> A small Python library. Bring your own models. Install it, give it a decision-model adapter, and run the quickstart.

Canonical: https://cyclotron.anth.us/developers

# A small Python library. Bring your own models.

The core needs no web server, database server, or hosted account. Give it a decision-model adapter and, for optimization, a completion function for the LLM you choose. The web workspace is optional.

Another provider needs one small adapter class. MIT license. Python 3.10 or later.

[Read the quickstart](https://github.com/AnthusAI/Cyclotron#use-the-core-library-without-the-workspace) · [View the source](https://github.com/AnthusAI/Cyclotron)

:::aside
The quickstart from the Cyclotron README. Cyclotron's test suite runs this exact code.
:::

## Cyclotrons, classifiers, and the loop around them.

:::aside
From the Cyclotron repository.
:::

### One item through several classifiers.

All classifiers share one decision-model request. In a store created with sharing, the default for new stores, a supporting question that several classifiers need is asked once and feeds each one's ML model. Review routing is per classifier: each is selected on its own confidence and its own audit sample, and one checklist review can label several. Each classifier has its own store, rubric and ML model. [Watch one item go through them →](/how-it-works#supporting-questions)

### Learning after the review.

Open a store with `learning="deferred"` and `review()` only records the labels and queues a learning pass for each labeled classifier, then returns. `await cyclotron.learn()` runs the queue, each classifier at most once per call, and `pending_learning()` lists what is waiting. With an asynchronous optimizer transport, the store is free while a pass waits on the optimizer, so reviews and decisions keep completing. The default is inline learning, which runs inside the review.

If a label the pass rests on is corrected, or a classifier's criteria change, during the wait, the pass is superseded: it is recorded, stays queued and runs again, up to a cap (`max_superseded_passes`). If a pass is interrupted, its own paid request is recorded as abandoned, and a repeat charge is possible; it is never silently re-paid.
