ComputerSettings (schemas/computer.py)

open-duet · backend/app/schemas/computer.py · python · Apache-2.0
infra, Infra / DevOps

Pydantic models for computer configuration and API responses.

# Source: https://github.com/Anil-matcha/open-duet | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from datetime import datetime
from typing import Literal

from pydantic import BaseModel, Field, model_validator

Network = Literal["none", "default"]


class ComputerSettings(BaseModel):
    # A Docker image reference; a digest (`name@sha256:…`) pins it. Omitted on
    # create: the pinned default image.
    image: str | None = Field(default=None, min_length=1, max_length=300)
    cpus: float | None = Field(default=None, ge=0.1, le=64)
    memory_mb: int | None = Field(default=None, ge=128, le=262_144)
    pids_limit: int | None = Field(default=None, ge=32, le=65_536)
    # none: no 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key