Skip to content
Back to skills

Ontologies And Model Interfaces

ASecurity

"Guides custom Autodistill ontologies, base/target model

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
designpythonapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill ontologies-and-model-interfaces --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ontologies And Model Interfaces?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ontologies And Model Interfaces
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-ontologies-and-model-interfaces/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-ontologies-and-model-interfaces)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ontologies-and-model-interfaces
description: "Guides custom Autodistill ontologies, base/target model
  interfaces, composed detection, and embedding workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Autodistill Ontologies and Model Interfaces

Use this sub-skill when a task asks how to design an ontology, implement a custom base or target model, check interface conformance, compose detection and classification models, or reason about embedding/text-classification surfaces.

Autodistill core classes define contracts; concrete model behavior normally lives in plugin packages. If the task is only to label a folder using an existing plugin, start with [dataset labeling](../dataset-labeling/SKILL.md). If the task is to pick a CLI alias or inspect installed plugins, start with [CLI and model registry](../cli-and-model-registry/SKILL.md).

## Quick Route

- **Exact signatures and abstract methods:** read [API reference](references/api-reference.md).
- **Build a custom base/target model:** read [custom model patterns](references/custom-model-patterns.md) for class skeletons, return objects, and conformance checks.
- **Combine detection and classification or use embeddings:** read [composed and embedding workflows](references/composed-and-embedding-workflows.md) for actual source class names and caveats.
- **Debug interface errors:** read [troubleshooting](references/troubleshooting.md) for abstract class instantiation, missing methods, ontology map errors, stale docs names, temp-file side effects, and set-of-marks limits.
- **Run safe conformance checks:** use [scripts/check_interfaces.py](scripts/check_interfaces.py). It constructs dummy models and validates core ontology/interface behavior without plugins.

## Core Pattern

A base model maps user data plus an ontology to predictions or labeled datasets:

```python
from autodistill.detection import CaptionOntology, DetectionBaseModel

class MyDetector(DetectionBaseModel):
    def __init__(self, ontology: CaptionOntology):
        self.ontology = ontology

    def predict(self, input):
        # return supervision.Detections
        ...
```

The inherited `DetectionBaseModel.label()` method will call `predict()` for every selected image and write the detection dataset. Use [dataset labeling](../dataset-labeling/SKILL.md) to validate the output layout.

## Ontology Design Rules

- Prompts are what the base model sees.
- Classes are what the dataset and target model will save.
- Keep class names stable before training; changing class order or labels changes target model semantics.
- `CaptionOntology` rejects empty mappings and raises lookup errors for missing prompts/classes.

## Snapshot Caveats

- Public docs mention `CustomDetectionModel` or `CombinedDetectionModel` in some composition examples. In this source snapshot, the available class is `autodistill.core.composed_detection_model.ComposedDetectionModel`.
- `TextClassificationBaseModel.label(...)` is a stub (`pass`) in this snapshot; do not claim it writes a dataset without a plugin override.
- Some embedding ontology methods and docs have implementation caveats; inspect and test with the concrete embedding model before large labeling jobs.

Files in this skill

  • SKILL.md3.2 KB
  • references/api-reference.md4.2 KB
  • references/composed-and-embedding-workflows.md3.2 KB
  • references/custom-model-patterns.md3.5 KB
  • references/troubleshooting.md2.7 KB
  • scripts/check_interfaces.py3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.