Claude Cursor Skill

ultralytics-platform

This skill should be used when user asks to "upload my model to Ultralytics Platform", "push this run to the platform", "upload a dataset to platform", "download a dataset from platform", "search platform datasets", "start cloud training", "train on platform GPUs", "export a mode

LLM Mart · 0 points · 7 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download fcakyon-claude-codex-settings-plugins_ultralytics-dev_skills_ultralytics-platform-8c25677.zip · 6 KB
Part of fcakyon/claude-codex-settings — 83 skills

Install

skills CLI npx skills add https://github.com/fcakyon/claude-codex-settings/tree/main/plugins/ultralytics-dev/skills/ultralytics-platform
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install fcakyon-claude-codex-settings@llmmart
Git git clone https://github.com/fcakyon/claude-codex-settings.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole fcakyon/claude-codex-settings collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Ultralytics Platform

Use ultralytics for local YOLO training and inference. Use the generated ultralytics-platform Python SDK for Platform resources, hosted inference, and AI annotation. It handles authentication, typed responses, retries, and errors.

Read the live contract

Before API work, check the generated API reference or GET https://platform.ultralytics.com/openapi.json. Treat the live OpenAPI document as authoritative when examples disagree. These recipes were checked against API and SDK v0.1.62 on 2026-09-24. Check the SDK source for generated method signatures.

uv pip install -U "ultralytics-platform>=0.1.62"
export ULTRALYTICS_API_KEY=ul_... # Settings > API Keys

Platform() reads ULTRALYTICS_API_KEY. The ultralytics package also reads the key saved by yolo login. Never print or commit a key.

Choose the interface

Goal Interface
Track a run that has not started ultralytics training callback
Train with a Platform dataset or model ultralytics with a ul:// URI
Manage datasets, models, training, exports, or deployments ultralytics-platform SDK
Predict with model weights or a dedicated endpoint client.models.predict / client.deployments.predict
Preview Moondream or other AI labels on a stored image client.images.predict
Save AI labels across a dataset client.datasets.create_batch
Use another language or inspect a new field Live OpenAPI

Live training and ul:// URIs

Pass an owner-qualified project to stream a run:

from ultralytics import YOLO

YOLO("yolo26n.pt").train(data="coco8.yaml", epochs=100, project="owner/project", name="run1")

project= is required. Without it, the callback exits before creating a Platform run. Use the owner prefix for a team workspace.

YOLO("ul://owner/project/model").train(data="ul://owner/datasets/dataset", epochs=100)

SDK

Use a context manager and owner/name paths. Keep returned IDs for operations that require them, including image operations, upload assetId, training modelId, and export IDs.

Responses have resource-specific shapes, not a generic envelope. Create calls return id, owner, and the URL name at the top level. Detail calls wrap the resource under its type, such as dataset. A rename changes the URL name, so use the name returned by the update response.

Read references/recipes.md for live-run diagnosis, finished-run upload, dataset upload, hosted inference, Moondream and other AI annotation, and billable jobs.

Invariants

  • Confirm the target workspace with client.account.summary() and read the exact resource before a mutation. Team work requires an API key created in that workspace.
  • Upload with a signed URL and PUT using the returned headers. Dataset ingest now verifies and completes the upload itself, so upload.complete is optional for datasets. Models still require it.
  • Dataset ingest accepts one source: sessionId, sourceUrl, or a connected-storage reference. Set targetSplit when every incoming image must enter one split.
  • Top-level model metrics accepts only the contract's named summary metrics. Per-epoch trainResults[].metrics accepts numeric metric names from results.csv.
  • Hosted AI annotation uses a stored image ID and dataset class names. It is not a free-form chat or caption API. Single-image predictions are unsaved, while batch annotation writes labels.
  • On 429, wait for Retry-After before retrying. Do not invent fixed sleeps.

Cost and destructive actions

Cloud training, model exports, deployments, and batch image processing can spend credits. Confirm the requested scope and cost before an unapproved billable launch. Do not ask again when the user has already authorized it. Check client.billing.usage_summary() for current usage and plan limits. Training returns cost estimates, but not every create response includes a price.

Get approval for deletes outside the user's authorized scope. Project, dataset, and model deletes move resources to 30-day trash. Image deletion and client.lifecycle.delete_trash are permanent.

Files (claude-codex-settings)
  • references
    • recipes.md 10.4 KB
      # Platform recipes
      
      These examples assume the SDK and authentication setup in [SKILL.md](../SKILL.md).
      
      ## Confirm the workspace and resource
      
      ```python
      from ultralytics_platform import Platform
      
      owner, dataset_name = "my-workspace", "my-dataset"
      
      with Platform() as client:
          account = client.account.summary()
          dataset = client.datasets.retrieve(owner, dataset_name)["dataset"]
      
      print(account["username"], dataset["status"], dataset["splits"])
      ```
      
      Use a key created in the target workspace. Before a mutation, verify the owner, URL name, status,
      and any fields the request will change. Read the resource again after the mutation.
      
      ## Track a new run
      
      ```bash
      uv pip install -U "ultralytics>=8.4.120"
      yolo login YOUR_API_KEY
      yolo train model=yolo26n.pt data=coco8.yaml epochs=100 project=owner/project name=run1
      ```
      
      At startup, expect `Platform: Streaming training metrics to Platform`. No line means the key or
      `project=` is missing. A `401` clears the cached key for that process. The callback uploads metrics,
      plots, console and system data, and final weights.
      
      ## Upload a finished run
      
      Create the project and model record, then upload `best.pt`. `trainResults` carries per-epoch numeric
      metrics. Top-level `metrics` is optional and limited to `mAP50`, `mAP50-95`, `precision`, `recall`,
      `accuracy_top1`, `accuracy_top5`, `miou`, `pixel_acc`, `delta1`, `abs_rel`, `rmse`, and `silog`.
      
      ```python
      from ultralytics_platform import Platform
      
      owner, project, model_name = "my-workspace", "my-project", "run1"
      train_results = [{"epoch": 1, "metrics": {"metrics/mAP50-95(B)": 0.42}}]
      
      with Platform() as client:
          created_project = client.projects.create(project=project, name="My Project", owner=owner)
          model = client.models.create(
              body={
                  "owner": created_project["owner"],
                  "project": created_project["project"],
                  "model": model_name,
                  "task": "detect",
                  "epochs": len(train_results),
                  "trainResults": train_results,
                  "metrics": {"mAP50-95": 0.42},
              }
          )
      ```
      
      Upload `best.pt` with the signed upload sequence below, using `assetType="models"`,
      `assetId=model["id"]`, and `contentType="application/octet-stream"`. Stop after
      `client.upload.complete`, then verify `client.models.files(model["owner"], model["project"],
      model["model"])["files"]`. Create calls can auto-suffix names, so use the returned names.
      
      ## Upload a dataset
      
      The archive must be ZIP, TAR, TAR.GZ, TGZ, or NDJSON. Loose images need an archive first.
      
      ```python
      from pathlib import Path
      
      import httpx
      from ultralytics_platform import Platform
      
      owner, dataset_name = "my-workspace", "my-dataset"
      archive = Path("my-dataset.zip")
      
      with Platform() as client:
          dataset = client.datasets.create(dataset=dataset_name, name="My Dataset", owner=owner, task="detect")
          signed = client.upload.signed_url(
              body={
                  "assetType": "datasets",
                  "assetId": dataset["id"],
                  "filename": archive.name,
                  "contentType": "application/zip",
                  "totalBytes": archive.stat().st_size,
              }
          )
          with archive.open("rb") as file:
              response = httpx.put(signed["uploadUrl"], content=file, headers=signed.get("headers"), timeout=3600)
          response.raise_for_status()
          client.datasets.ingest(
              dataset["owner"],
              dataset["dataset"],
              body={"sessionId": signed["sessionId"]},
          )
      ```
      
      Ingest is asynchronous. Poll
      `client.datasets.retrieve(dataset["owner"], dataset["dataset"])["dataset"]` until `status` is
      `ready` or `failed`, then verify split counts, class names, annotations, and `errorCount`. For a remote
      archive, skip upload and ingest with `body={"sourceUrl": "https://.../data.zip"}`. Add
      `targetSplit` only when every incoming image should enter one split. `conflictPolicy` accepts
      `skip`, `keep_both`, or `replace`. Dataset ingest completes signed uploads automatically.
      
      ## Download or search
      
      Use the `ul://` form in [SKILL.md](../SKILL.md) for YOLO. Use
      `client.datasets.export(owner, dataset)["downloadUrl"]` for an NDJSON download, or
      `client.explore.search(q="weld defect", type="datasets", task="detect")` for public discovery.
      Pass `v=VERSION` to export a saved dataset version. `client.datasets.create_export(owner, dataset)`
      creates a version, while `client.datasets.restore(owner, dataset, version=VERSION)` restores one.
      
      ## Hosted model inference
      
      `client.models.predict` runs trained model weights. `client.deployments.predict` uses an existing
      dedicated endpoint. Pass a binary `file` in `body` to send multipart form data. Use `conf` here, not
      the annotation API's `confidence`. OpenAPI also accepts an image URL/base64 `source`, but SDK v0.1.62
      sends source-only bodies as URL-encoded forms instead of the specified multipart form. Prefer the
      file form with this SDK version.
      
      ```python
      from pathlib import Path
      
      from ultralytics_platform import Platform
      
      with Platform() as client, Path("image.jpg").open("rb") as image:
          result = client.models.predict("ultralytics", "yolo26", "yolo26n", body={"file": image, "conf": 0.25})
          print(result["images"][0]["results"])
      ```
      
      For a deployment, use `client.deployments.predict(owner, deployment, body={"file": image})` with
      the file open. Results are grouped under `images` with `shape`, `speed`, and `results`, plus top-level
      `metadata`. Boxes use pixel coordinates unless `normalize=True`. Model inference also accepts video
      files, with one result per frame. Depth models accept images only and return an encoded depth map.
      
      ## Moondream and other AI annotation
      
      Use `client.images.predict(image_id, model_id="moondream")` for an image already in a Platform
      dataset. This calls `POST /api/images/{imageId}/predict`, not Moondream's own API. The request accepts
      `modelId`, `confidence`, `iou`, and `classMapping`, not a free-form prompt or an image file.
      
      The v0.1.62 `modelId` enum includes `moondream`, `qwen`, `florence2`, `owlv2`, `yoloe26x`, `sam3`,
      `sam3.1`, and `groundingdino`. It also lists provider models such as `gpt-6-astra`, `claude-fable-5-1`,
      and `gemini-3.8-flash`. Read the live enum for the current full list. A YOLO model uses an
      `ul://owner/project/model` URI instead of a hosted model ID.
      
      Hosted models detect the dataset's class names, with 1-100 classes and model-specific thresholds.
      They do not return confidence scores. YOLO can return index-aligned `confidences`, and accepts
      `class_mapping` to map each model class to a dataset class index or `None` to drop it. These calls
      require dataset update permission. Connected datasets and depth datasets cannot use auto-annotation.
      `images.retrieve` returns `properties.datasetId`, `classNames`, and `labels`. Compare that dataset ID
      with the intended dataset's `id` before annotation, and display class names using each `classId`.
      
      ```python
      from ultralytics_platform import Platform
      
      image_id = "507f1f77bcf86cd799439011"
      
      with Platform() as client:
          image = client.images.retrieve(image_id)
          print(image["classNames"], image["labels"])
          prediction = client.images.predict(image_id, model_id="moondream")
          print(prediction["modelUsed"], prediction.get("partial", False), prediction["predictions"])
      ```
      
      `predictions` are proposed annotations, not saved labels. `partial=True` means output was truncated:
      complete boxes were recovered, but objects or classes may be missing. Review before saving.
      Annotations use `classId` and normalized `bbox=[x_center, y_center, width, height]`, with task-specific
      geometry where applicable. Do not treat these as the model-inference response's pixel corner boxes.
      
      To save reviewed predictions within the requested scope, call
      `client.images.update(image_id, body={"labels": prediction["predictions"]})`, then retrieve the image
      again. This replaces all existing labels. If retaining them, explicitly merge the reviewed label
      sets first. Do not overwrite from a retrieval with `labelsTruncated=True`.
      
      ### Batch annotation and face blurring
      
      Check `client.datasets.batch(owner, dataset)` before creating a run. After the user has authorized
      the dataset, model, and billable scope:
      
      ```python
      from ultralytics_platform import Platform
      
      with Platform() as client:
          job = client.datasets.create_batch(
              "my-workspace", "my-dataset", body={"modelId": "moondream", "includeAnnotated": False}
          )
          print(job["jobId"])
          print(client.datasets.batch("my-workspace", "my-dataset"))
      ```
      
      Batch annotation saves a dataset version, queues inference, and writes labels to unannotated images
      by default. `includeAnnotated=True` also targets labeled images. Poll `datasets.batch` for
      `activeJob.progress`, then inspect `lastRun.failed`, `stopped`, `error`, and `results.partialImages`.
      The response has `activeJob` and `lastRun`, not a generic `status`. Match their `id` to the returned
      `jobId`. Stop polling when that job finishes or the agreed time limit is reached.
      `datasets.delete_batch` cancels an active run or settles billing and dismisses a finished run.
      A `409` can mean an existing run, an unready dataset, or no
      eligible images, so inspect the state before resubmitting. A `402` means insufficient credits.
      
      The same batch API accepts `body={"operation": "blur", "preview": True}` to preview face blurring
      on up to six images. Apply those prepared assets with `previewJobId` and the same settings after
      review. Blurring changes pixels, preserves labels, creates no dataset version, and is billed by images
      processed. Do not mistake it for annotation or start it when the user only requested predictions.
      
      ## Billable jobs
      
      Confirm billable scope as described in [SKILL.md](../SKILL.md). Query availability rather than
      hard-coding GPU stock.
      
      ```python
      from ultralytics_platform import Platform
      
      with Platform() as client:
          print(client.training.gpu_availability())
          job = client.training.start(
              model_id="MODEL_ID",
              gpu_type="rtx-4090",
              capture_dataset_version=True,
              train_args={"model": "yolo26n.pt", "data": "ul://owner/datasets/dataset", "epochs": 100},
          )
          print(job["billing"]["estimatedCostDisplay"])
      
          client.exports.create("owner", "project", "model", format="onnx")
          client.deployments.create(
              "owner",
              project="project",
              model="model",
              deployment="production",
              name="Production",
              region="europe-west1",
          )
      ```
      
      `capture_dataset_version=True` saves an immutable dataset version for the training run. Training
      returns `estimatedCost.pricePerHour` and billing details after it starts. Export and deployment
      availability depends on the workspace plan and quota.
      
  • SKILL.md 5.1 KB
    ---
    name: ultralytics-platform
    description: This skill should be used when user asks to "upload my model to Ultralytics Platform", "push this run to the platform", "upload a dataset to platform", "download a dataset from platform", "search platform datasets", "start cloud training", "train on platform GPUs", "export a model on platform", "deploy a model endpoint", "run Moondream on Platform", "auto-annotate a Platform dataset", "run hosted AI inference", "why is my run not showing on platform", or mentions platform.ultralytics.com, ul:// URIs, ultralytics-platform, or ULTRALYTICS_API_KEY.
    ---
    
    # Ultralytics Platform
    
    Use `ultralytics` for local YOLO training and inference. Use the generated `ultralytics-platform`
    Python SDK for Platform resources, hosted inference, and AI annotation. It handles authentication,
    typed responses, retries, and errors.
    
    ## Read the live contract
    
    Before API work, check the generated [API reference](https://platform.ultralytics.com/api/docs) or
    `GET https://platform.ultralytics.com/openapi.json`. Treat the live OpenAPI document as authoritative
    when examples disagree. These recipes were checked against API and SDK v0.1.62 on 2026-09-24.
    Check the [SDK source](https://github.com/ultralytics/sdk) for generated method signatures.
    
    ```bash
    uv pip install -U "ultralytics-platform>=0.1.62"
    export ULTRALYTICS_API_KEY=ul_... # Settings > API Keys
    ```
    
    `Platform()` reads `ULTRALYTICS_API_KEY`. The `ultralytics` package also reads the key saved by
    `yolo login`. Never print or commit a key.
    
    ## Choose the interface
    
    | Goal                                                       | Interface                        |
    | ---------------------------------------------------------- | -------------------------------- |
    | Track a run that has not started                           | `ultralytics` training callback  |
    | Train with a Platform dataset or model                     | `ultralytics` with a `ul://` URI |
    | Manage datasets, models, training, exports, or deployments | `ultralytics-platform` SDK       |
    | Predict with model weights or a dedicated endpoint        | `client.models.predict` / `client.deployments.predict` |
    | Preview Moondream or other AI labels on a stored image    | `client.images.predict`          |
    | Save AI labels across a dataset                          | `client.datasets.create_batch`   |
    | Use another language or inspect a new field                | Live OpenAPI                     |
    
    ### Live training and `ul://` URIs
    
    Pass an owner-qualified project to stream a run:
    
    ```python
    from ultralytics import YOLO
    
    YOLO("yolo26n.pt").train(data="coco8.yaml", epochs=100, project="owner/project", name="run1")
    ```
    
    `project=` is required. Without it, the callback exits before creating a Platform run. Use the
    owner prefix for a team workspace.
    
    ```python
    YOLO("ul://owner/project/model").train(data="ul://owner/datasets/dataset", epochs=100)
    ```
    
    ### SDK
    
    Use a context manager and owner/name paths. Keep returned IDs for operations that require them,
    including image operations, upload `assetId`, training `modelId`, and export IDs.
    
    Responses have resource-specific shapes, not a generic envelope. Create calls return `id`, `owner`,
    and the URL name at the top level. Detail calls wrap the resource under its type, such as `dataset`.
    A rename changes the URL name, so use the name returned by the update response.
    
    Read [references/recipes.md](references/recipes.md) for live-run diagnosis, finished-run upload,
    dataset upload, hosted inference, Moondream and other AI annotation, and billable jobs.
    
    ## Invariants
    
    - Confirm the target workspace with `client.account.summary()` and read the exact resource before a
      mutation. Team work requires an API key created in that workspace.
    - Upload with a signed URL and `PUT` using the returned `headers`. Dataset ingest now verifies and
      completes the upload itself, so `upload.complete` is optional for datasets. Models still require it.
    - Dataset ingest accepts one source: `sessionId`, `sourceUrl`, or a connected-storage `reference`.
      Set `targetSplit` when every incoming image must enter one split.
    - Top-level model `metrics` accepts only the contract's named summary metrics. Per-epoch
      `trainResults[].metrics` accepts numeric metric names from `results.csv`.
    - Hosted AI annotation uses a stored image ID and dataset class names. It is not a free-form chat or
      caption API. Single-image predictions are unsaved, while batch annotation writes labels.
    - On `429`, wait for `Retry-After` before retrying. Do not invent fixed sleeps.
    
    ## Cost and destructive actions
    
    Cloud training, model exports, deployments, and batch image processing can spend credits. Confirm
    the requested scope and cost before an unapproved billable launch. Do not ask again when the user
    has already authorized it. Check `client.billing.usage_summary()` for current usage and plan limits.
    Training returns cost estimates, but not every create response includes a price.
    
    Get approval for deletes outside the user's authorized scope. Project, dataset, and model deletes
    move resources to 30-day trash. Image deletion and `client.lifecycle.delete_trash` are permanent.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related