Model Routers¶
These capsules take the detections of other capsules and send them, with a prompt, to a cloud AI model through its API: Claude Classifier Agent (Anthropic), ChatGPT Classifier Agent (OpenAI), and Classifier Model Router, which lets you select the provider in its options: Claude, ChatGPT, Gemini, Qwen, GLM, DeepSeek, or any OpenAI-compatible server. A third-party account and fee are required (some providers have a free tier).
To see how a model router works together with other capsules, see Capsule Fusion and Model Router.
| Name | Description | Hardware | Required Input | Output |
|---|---|---|---|---|
| Chatgpt Classifier Agent | Expandv0.8 The capsule takes detections from other capsules, and send a prompt request to OpenAI API for classification and add the answer to the extra data (chatgpt) of that person, for BrainFrame API or for other capsules to consume and generate fused results. |
CPU | Type: List of Detections Detections: person |
Type: List of Detections Extra data: chatgpt |
| Classifier Model Router | Expandv0.8. Routes to Claude, ChatGPT, Gemini, Qwen, GLM, DeepSeek, or any OpenAI-compatible model (also a local one). The capsule takes the detections of other capsules (the classes named in the input_classes option: person by default), cuts each one out of the frame and asks the model selected by the provider option (a drop-down list; claude is the default) about the picture with a prompt (for example: is the person wearing a hard hat?). The answer is added to the extra data of that person under the key model_router, for the BrainFrame API and for other capsules to use. Fill in the API key of the selected provider. To control the cost, at most max_detections detections are sent every api_call_interval seconds, and max_api_calls limits the number of calls. |
CPU | Type: List of Detections |
Type: List of Detections Extra data: model_router |
| Claude Classifier Agent | v0.2. The capsule takes detections from other capsules, and send a prompt request to Anthropic API for classification and publish the answers to BrainFrame API or for other capsules to consume and generate fused results. | CPU | Type: List of Detections Detections: person |
Type: List of Detections Detections: claude Extra data: claude |
Source Code and Your Own Model Router¶
The source code of the model routers is open, in the
capsules directory of the Capsule Zoo on GitHub:
classifier_model_router,
claude_classifier_agent and
chatgpt_classifier_agent.
You can implement a model router of your own that sends the detections to a server of your private LLM model, so that the
images stay inside your network. Start from the code of classifier_model_router. It already works with any
OpenAI-compatible server (set the provider to custom, and fill in base_url and custom_model); for a server with a
different API, change the backend of the capsule to call it. To write and package a capsule, see the
tutorial Creating a Basic Capsule.