Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

15.7 KB
Raw Blame
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ods.ai/schemas/service-manifest.v1.json",
  "title": "ODS Service Manifest v1",
  "type": "object",
  "required": ["schema_version", "service"],
  "properties": {
    "schema_version": {
      "const": "ods.services.v1"
    },
    "compatibility": {
      "type": "object",
      "description": "ODS version compatibility; used by validate-manifests.sh for version checks",
      "properties": {
        "ods_min": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$",
          "description": "Minimum ODS version this extension supports (e.g. 2.0.0)"
        },
        "ods_max": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$",
          "description": "Maximum ODS version this extension was tested against (optional)"
        }
      },
      "additionalProperties": false
    },
    "service": {
      "type": "object",
      "required": ["id", "name", "port", "type", "category"],
      "allOf": [
        {
          "if": {
            "anyOf": [
              {
                "properties": { "host_network": { "const": true } },
                "required": ["host_network"]
              },
              {
                "properties": { "socket_only": { "const": true } },
                "required": ["socket_only"]
              }
            ]
          },
          "then": {},
          "else": { "required": ["port", "health"] }
        },
        {
          "if": {
            "properties": { "socket_only": { "const": true } },
            "required": ["socket_only"]
          },
          "then": {
            "properties": {
              "type": { "const": "host-systemd" },
              "port": { "const": 0 }
            }
          }
        }
      ],
      "properties": {
        "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
        "name": { "type": "string", "minLength": 1 },
        "aliases": {
          "type": "array",
          "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
          "description": "CLI shorthand aliases for this service"
        },
        "container_name": {
          "type": "string",
          "description": "Docker container name for ods shell"
        },
        "container_uid": {
          "type": "integer",
          "minimum": 1,
          "description": "Numeric UID the container process runs as when it is not visible from compose.user. Used by the host agent to prepare bind-mounted data directories."
        },
        "host_env": { "type": "string" },
        "default_host": { "type": "string" },
        "port": { "type": "integer", "minimum": 0, "maximum": 65535 },
        "external_port_env": { "type": "string" },
        "external_port_default": { "type": "integer", "minimum": 0, "maximum": 65535 },
        "public_url_env": {
          "type": "string",
          "description": "Optional env var that contains the public browser URL for this service when served through an external reverse proxy."
        },
        "host_network": {
          "type": "boolean",
          "description": "True for Docker network_mode: host services that do not declare Docker-mapped ports or HTTP health paths."
        },
        "socket_only": {
          "type": "boolean",
          "description": "True only for host-systemd services whose HTTP-compatible interface is exposed exclusively over a Unix-domain socket and therefore has no TCP port."
        },
        "health": {
          "type": "string",
          "minLength": 0,
          "description": "HTTP health path. Use an empty string for non-HTTP or one-shot services whose readiness is represented by container state/startup_check."
        },
        "health_timeout": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300,
          "description": "Health check timeout in seconds (default: 10)"
        },
        "health_auth_env": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9_]{1,127}$",
          "description": "Extension-owned secret environment variable used as a Bearer token for dashboard HTTP readiness. Must start with the upper-case service ID (hyphens replaced by underscores), followed by an underscore, and be declared secret in env_vars. Tokens are resolved at probe time, never embedded in the manifest."
        },
        "health_source": {
          "type": "string",
          "enum": ["http", "container"],
          "description": "Health authority used by host-side CLI checks. Defaults to http; use container only for internal-only Docker services with a declared Docker healthcheck."
        },
        "ui_path": {
          "type": "string",
          "pattern": "^/.*",
          "description": "Path to the service UI (e.g. /dashboard, /)"
        },
        "external_link": {
          "type": "boolean",
          "description": "When false, omit this service from dashboard external quicklinks while keeping it in health/status APIs."
        },
        "macos_host_supported": {
          "type": "boolean",
          "description": "True when a host-systemd service has an equivalent macOS LaunchAgent and should remain in the Apple service registry."
        },
        "type": { "type": "string", "enum": ["docker", "host-systemd"] },
        "startup_check": {
          "type": "boolean",
          "description": "When false, skip the post-install running-state poll and treat compose's clean exit as success. Set this on one-shot CLI / setup-only extensions whose containers intentionally exit (default: true)."
        },
        "startup_timeout": {
          "type": "integer",
          "minimum": 1,
          "maximum": 600,
          "description": "Seconds the host agent polls for the container to reach the running state before declaring install failed (default: 15). Increase for extensions with heavy initialization (e.g. JVM, postgres, clickhouse)."
        },
        "gpu_backends": {
          "type": "array",
          "items": { "type": "string", "enum": ["amd", "nvidia", "apple", "cpu", "none", "all"] },
          "minItems": 1
        },
        "host_requirements": {
          "type": "object",
          "description": "Hosts the service's image can run on, for an image upstream does not build for every CPU architecture or kernel page size. Outside them the Dashboard marks the service incompatible and refuses to prepare or enable it. Docker Desktop on macOS runs amd64 images under Rosetta 2, so architectures do not apply there.",
          "properties": {
            "architectures": {
              "type": "array",
              "items": { "type": "string", "enum": ["amd64", "arm64"] },
              "minItems": 1,
              "uniqueItems": true,
              "description": "Docker architectures the image runs on natively."
            },
            "max_page_size": {
              "type": "integer",
              "enum": [4096, 16384, 65536],
              "description": "Largest kernel page size, in bytes, the image runs with (4096 for a jemalloc built for 4 KB pages)."
            }
          },
          "minProperties": 1,
          "additionalProperties": false
        },
        "compose_file": {
          "type": "string",
          "description": "Relative path to compose fragment (e.g. compose.yaml)"
        },
        "category": {
          "type": "string",
          "enum": ["core", "recommended", "optional"],
          "description": "core = always on, recommended = enabled by default, optional = user opts in"
        },
        "depends_on": {
          "type": "array",
          "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
          "description": "Service IDs this service depends on"
        },
        "env_vars": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["key"],
            "properties": {
              "key": { "type": "string" },
              "required": { "type": "boolean" },
              "secret": { "type": "boolean" },
              "description": { "type": "string" },
              "default": { "type": "string" },
              "format": {
                "type": "string",
                "enum": ["hex32", "hex64", "hex128", "email", "url", "integer"],
                "description": "Named value format checked by the dashboard and dashboard-api before the value is saved: hexN = exactly N hexadecimal characters in either case (add a pattern where the service accepts only lowercase); email; url = http(s) URL without credentials; integer = positive whole number without leading zeros."
              },
              "pattern": {
                "type": "string",
                "pattern": "^\\^(?!.*\\\\[dDwWbBAZzGQEpP])(?!.*\\(\\?(?![=!:])).*\\$$",
                "maxLength": 512,
                "description": "Anchored regular expression the whole value must match, in addition to format. Must behave identically in Python re and JavaScript RegExp: use explicit classes such as [0-9] (no \\d, \\w, \\b), no \\p escapes, and no group opener other than (?: (?= (?!. Requires format_description."
              },
              "format_description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "description": "Short owner-facing explanation of pattern, read after \"must be\" (for example \"letters and digits only\")."
              },
              "min_length": {
                "type": "integer",
                "minimum": 1,
                "maximum": 4096,
                "description": "Minimum value length in characters."
              },
              "max_length": {
                "type": "integer",
                "minimum": 1,
                "maximum": 4096,
                "description": "Maximum value length in UTF-8 bytes (for example 72 for bcrypt-hashed passwords)."
              },
              "generate": {
                "type": "string",
                "enum": ["hex32", "hex64", "hex128", "password", "token"],
                "description": "The dashboard may offer a crypto-random value: hexN = N lowercase hexadecimal characters, password = 24 letters and digits, token = 48 letters and digits. The generated value must satisfy format, pattern and lengths."
              },
              "distinct_from": {
                "type": "array",
                "items": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,127}$" },
                "minItems": 1,
                "maxItems": 8,
                "uniqueItems": true,
                "description": "Other settings declared by this manifest that this value must differ from (for example when the service refuses to start with two equal secrets)."
              }
            },
            "dependentRequired": { "pattern": ["format_description"], "format_description": ["pattern"] },
            "additionalProperties": false
          },
          "description": "Environment variables used by this service"
        },
        "llm": {
          "type": "object",
          "description": "Declares whether and how this service consumes LLM inference so model swaps can be gated and probed.",
          "required": ["consumes"],
          "properties": {
            "consumes": {
              "type": "boolean",
              "description": "True when this service sends prompts/completions to an LLM endpoint."
            },
            "route": {
              "type": "string",
              "enum": ["gateway", "direct"],
              "description": "gateway routes through the ODS model gateway alias; direct talks to a runtime or app-specific endpoint."
            },
            "pinning": {
              "type": "string",
              "enum": ["none", "dynamic"],
              "description": "none stores no model name; dynamic declares a refresh/reconcile path after swaps."
            },
            "min_context": {
              "type": "integer",
              "minimum": 0,
              "description": "Optional minimum context length required for this app's LLM path."
            },
            "probe": {
              "type": "object",
              "description": "Harness probe descriptor used after every model swap.",
              "properties": {
                "kind": { "type": "string", "enum": ["chat", "completion", "custom"] },
                "path": { "type": "string" },
                "auth": { "type": "string" }
              },
              "additionalProperties": true
            }
          },
          "allOf": [
            {
              "if": {
                "properties": { "consumes": { "const": true } },
                "required": ["consumes"]
              },
              "then": { "required": ["route", "pinning", "probe"] }
            }
          ],
          "additionalProperties": true
        },
        "setup_hook": {
          "type": "string",
          "description": "Relative path to a setup script run during installation (e.g. setup.sh)"
        },
        "hooks": {
          "type": "object",
          "description": "Lifecycle hook scripts. Paths relative to extension directory.",
          "properties": {
            "pre_install": { "type": "string" },
            "post_install": { "type": "string" },
            "pre_start": { "type": "string" },
            "post_start": { "type": "string" },
            "pre_uninstall": { "type": "string" },
            "post_uninstall": { "type": "string" }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": true
    },
    "features": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "name", "description", "icon", "category", "requirements", "priority"],
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
          "name": { "type": "string", "minLength": 1 },
          "description": { "type": "string", "minLength": 1 },
          "icon": { "type": "string", "minLength": 1 },
          "category": { "type": "string", "minLength": 1 },
          "requirements": {
            "type": "object",
            "properties": {
              "services": { "type": "array", "items": { "type": "string" } },
              "services_any": { "type": "array", "items": { "type": "string" } },
              "vram_gb": { "type": "number", "minimum": 0 },
              "vram_mb": { "type": "number", "minimum": 0 },
              "disk_gb": { "type": "number", "minimum": 0 }
            },
            "additionalProperties": true
          },
          "enabled_services_all": { "type": "array", "items": { "type": "string" } },
          "enabled_services_any": { "type": "array", "items": { "type": "string" } },
          "setup_time": { "type": "string" },
          "priority": { "type": "integer", "minimum": 1 },
          "launch": {
            "type": "object",
            "description": "Dashboard feature-card launch target. Use type=service for user-facing service UIs, internal for dashboard routes, and none for backend/API-only features.",
            "required": ["type"],
            "properties": {
              "type": { "type": "string", "enum": ["service", "internal", "none"] },
              "service": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
              "path": { "type": "string", "pattern": "^/.*" }
            },
            "additionalProperties": false
          },
          "gpu_backends": {
            "type": "array",
            "items": { "type": "string", "enum": ["amd", "nvidia", "apple", "cpu", "none", "all"] },
            "minItems": 1
          }
        },
        "additionalProperties": true
      }
    },
    "tags": {
      "type": "array",
      "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
      "description": "Categorization tags for service discovery"
    }
  },
  "additionalProperties": true
}