Add ecosystem

From civitai/civitai · View interactive version

Add ecosystem is an AI agent skill from the GitHub repository civitai/civitai. Add a new ecosystem and base model to basemodel.constants.ts. Use when onboarding a new model family from providers like Baidu, ByteDance, Google, etc. Handles ECO constants, BM constants, ecosystem record, family (creates new if needed), license (creates new if needed), and base model record. Optio

How to use this skill

Skill file

Add Ecosystem

Adds a new ecosystem and base model entry to basemodel.constants.ts. Everything else downstream (generation support, graph, handler, workflow wiring) is handled by the add-generation-support skill.

When to use

Use when a new model provider or variant is being added to Civitai — e.g., new provider (Baidu's Ernie), new architecture (Flux's Kontext), or a variant of an existing family whose resources aren't interchangeable with its siblings.

This skill has two modes, and you should only be here if one of them applies:

A new release of an API-only model that already has an ecosystem usually needs neither. It becomes a new model version under the existing base model, with no constants change. Stop and say so — unless the existing base model is hosted weights whose licence, restrictions or LoRAs must not apply to the API release; then use Base model only with hidden: true (Ideogram 4.5 beside Ideogram 4.0). onboard-generator-model Phase 0 has the full decision.

The test: does this need its own ecosystem?

Answer this before picking IDs. The ecosystem is the compatibility key, not a UI grouping and not a media label:

A variant needs its own ecosystem when a LoRA (or other addon) trained for it would NOT work on every model carrying the sibling's baseModel.

That is the whole test. getGenerationSupport returns 'full' unconditionally for same-ecosystem pairs — there is no media dimension and no per-model nuance in it. Putting two things in one ecosystem asserts "resources cross freely between these," so only do it when that's true.

Architecture is not weights. The most common way to get this wrong is reading a vendor's "one unified model" marketing as "one checkpoint." Providers routinely ship a shared architecture as separate weight releases, and a LoRA is trained against weights. Check what actually ships — distinct releases, distinct sizes, distinct endpoints — not what the announcement calls the family.

Do not split on output media. "Image vs video" is not the question; "do resources cross" is. If one checkpoint does both, that's one ecosystem with a type: ['image', 'video'] base model (Grok). If they're separate checkpoints that happen to differ in output media, that's two ecosystems (Wan Image 2.7 / Wan Video 2.7 — note there are deliberately no crossEcosystemRules between them).

When genuinely unsure, split. The two mistakes are not symmetric:

| Choice | If wrong | Cost to fix |

| --- | --- | --- |

| Split, but they're compatible | Resources don't cross | Add crossEcosystemRules entries — additive, that's what the mechanism is for |

| Merged, but they're incompatible | Incompatible resources offered as compatible | Change the ecosystem key → changes the AIR URN namespace on already-published resources |

Splitting is reversible; merging is not. This is doubly true when you're creating the first ecosystem for an API-only line: no community resources exist yet, so the split costs nothing today and keeps the option open. This doesn't apply to a later release in that line, which gets no new records at all (see "When to use").

Media-specific labelling for creators is a BaseModelRecord concern, not an ecosystem one — several base models can share one ecosystem, each with its own name and type.

Workflow (interactive after research)

Do research first, then ask the user only for what can't be inferred.

1. Gather model info

Ask the user for the model name and a reference link (HuggingFace page, official repo, announcement). Then research before asking anything else:

2. Pick IDs

Read the current state of basemodel.constants.ts to determine the next available IDs. Use Read with offsets — don't load the whole file.

ranges. Take the next unused number above the highest root ID (the Root ecosystems blocks), and

never enter a child range: 100-199 is SDXL children, 200+ AuraFlow children. When the next root

number would be 100 or above, ask the user to pick a new root block.

3. Confirm the plan with the user

Before editing, present a summary:

Adding ecosystem: <DisplayName>
- ECO.<Name> = <id>
- BM.<Name> = <id>
- Family: <existing family name> (familyId: <id>) OR [new: <name>]
- License: <existing license name> (licenseId: <id>) OR [new: <name>, <url>]
- Type: image | video
- sortOrder: <n>
- Description: "<short description>"

Wait for user confirmation. Accept corrections.

4. Make the edits

Apply all changes in one pass:

  1. ECO constant: add the new key under the appropriate section comment (e.g., // Baidu for Ernie). Keep sections grouped.
  2. BM constant: add the new key in the matching block.
  3. ecosystemFamilies (only if creating new): append at the end. Use the next family ID.
  4. licenses (only if creating new): append at the end. Use the next license ID.
  5. ecosystems: add the new EcosystemRecord under the right family's section comment. Include parentEcosystemId only if it's a child ecosystem (rare).
  6. baseModelRecords: add the new BaseModelRecord in alphabetical or thematic position (scan existing entries for the pattern).

5. Typecheck

pnpm run typecheck

If it fails, fix the error and re-run. Don't continue until clean.

6. Offer generation support

After the ecosystem is added and typecheck passes, ask:

Do you want to add generation support now? This wires the ecosystem into the generation form with a graph, handler, and workflow config. (Runs the add-generation-support skill.)

If yes, invoke the add-generation-support skill. If no, stop — the ecosystem record alone is enough for it to appear in model listings.

Skip this offer when you were invoked by onboard-generator-model. Generation support hardcodes the version ID of the official checkpoint. That version can't be created until this change is deployed, because modelVersion.upsert rejects base-model names the running server doesn't know.

Note: making a new ecosystem generatable (GenerationBaseModel) and featurable in auctions (AuctionBase) are manual DB steps that the constants do not handle automatically — miss them and the feature silently half-works (this bit Anima and Krea 2). Those steps are documented in the add-generation-support skill under "Post-onboarding: generation coverage & auction featurability."

Record structures

`EcosystemRecord`

{
  id: ECO.<Name>,
  key: '<Name>',                // Stable identifier (e.g., 'Ernie')
  name: '<name>',               // lowercase (e.g., 'ernie')
  displayName: '<Display Name>', // UI (e.g., 'Ernie')
  familyId: <id>,
  sortOrder: <n>,
  parentEcosystemId?: <id>,     // Only for child ecosystems
  description?: string,         // Rarely needed
}

`BaseModelRecord`

{
  id: BM.<Name>,
  name: '<Name>',
  description: "<Provider>'s <type> generation model",
  type: 'image' | 'video' | ['image', 'video'],
  ecosystemId: ECO.<Name>,
  licenseId: <id>,
  hidden?: boolean,      // true if not user-facing yet
  experimental?: boolean,
  disabled?: boolean,
  matureRestricted?: ('generation' | 'models' | 'images')[], // when the terms of use restrict mature content; see docs/nsfw-license-restrictions.md
}

`BaseModelFamilyRecord` (create only if needed)

{
  id: <next id>,
  name: '<Provider Name>',
  description: "<Provider>'s <description of product lineup>",
}

`LicenseRecord` (create only if needed)

{
  id: <next id>,
  name: '<License Name>',       // Exact name from the source
  url: '<canonical license URL>',
  notice?: string,              // Only if the license requires a copyright notice
  poweredBy?: string,           // Only if attribution is required
}

Notes

Examples of past additions

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.