Observed since 21 Oct, 11:14 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AI Marketplace Platform CLI
Python CLI for publishing and managing marketplace models.
Requirements:
Install with uv:
uv tool install ./cli
Or with pipx:
pipx install ./cli
For local development:
cd cli
uv sync --extra dev
uv run ai --help
aiWith no arguments on an interactive terminal, opens the branded launcher.
When the current directory contains main.py and pyproject.toml, the launcher switches to
project-aware actions such as editing publish settings. Remote
marketplace model tools are grouped under a Marketplace Models submenu instead of appearing
as top-level home actions.
Without interactive stdin/stdout, prints help.
Launcher controls:
Enter to selectEsc to cancel or go back from prompt screensCtrl-C to exitai initCreate a single-model framework and platform project:
main.pyinternal/ (loader.py, inference.py)playground.pyschemas.pytests/tuning/runtime/Dockerfile.aimp/project.toml.aimp/publish.tomlstudio/article.mdxstudio/cover.jpgpyproject.tomlPROJECT.md and .agents/skills/pyproject.toml is the only local source of truth for project identity and version:
[project] owns name, version, and description[tool.aimp.project] owns author metadata such as authorThe hidden .aimp/project.toml also carries one CLI-managed [publish] section used only
for source-bundle packaging metadata:
[publish]
artifact_path = "artifacts"
artifact_format = "tar.zst"
This is operational publish config, not author-facing contract logic.
Remote publish always builds from runtime/Dockerfile with runtime/pyproject.toml
at the project root. The CLI does not substitute a platform-managed Dockerfile on the publish
path; those helpers exist only for tests and legacy tooling.
internal/loader.py holds lifecycle hooks; main.py defines public modes with decorated functions:
from aimp_sdk import Model, mode
from internal.loader import ExampleEngine
from schemas import ExampleSchema
class Example(Model):
engine = ExampleEngine
@mode(name="example")
async def example(
self,
inputs: ExampleSchema.Inputs,
params: ExampleSchema.Params,
) -> ExampleSchema.Outputs:
_ = params
return ExampleSchema.Outputs(result=inputs.query.strip())
Examples:
ai init my-model
ai init my-model --yes
ai init my-model --json
ai init now scaffolds the default unified project immediately. The official next steps are:
cd my-model
uv sync
ai publish --configure
ai push
ai loginAuthenticate and persist credentials in ~/.aimp/config.json.
When the Gateway URL is not passed with --gateway, the CLI suggests a default in this order:
AIMP_GATEWAY_URL → logs/stage-runtime.json (from make stage-up or Quick Tunnel) → STAGE_GATEWAY_PUBLIC_URL in infra/vm/stage.public.env → http://localhost:8080. Malformed values in stage.public.env fail fast with a clear error.
Examples:
ai login
ai login --gateway http://localhost:8080 --api-key pk_live_xxx
printf '%s' "$AIMP_API_KEY" | ai login --gateway http://localhost:8080 --stdin
ai authShow current authentication status.
ai logoutRemove stored credentials.
ai publishPackage, upload, remotely build, and publish the current model.
Requirements:
main.pypyproject.toml.aimp/publish.toml or a TTY session for guided configuration.env (empty file allowed for zero secrets)runtime/Dockerfile and runtime/pyproject.toml (both required; incomplete runtime/ is rejected; there is no publish fallback image)Publish does not require local registry credentials or local Docker daemon access. The CLI packages a source bundle and the platform performs the build.
For local stack development, the platform-side Build Service still needs its own registry
Docker config secret. Use make repair-local-registry-auth to provision or repair that
platform secret contract before retrying a failed remote publish push.
ai publish now owns publish setup. If .aimp/publish.toml is missing or invalid and the
session is interactive, the CLI fetches the platform hardware catalog from Gateway, lets you
choose tiers and developer margin, then writes the hidden config before publishing.
Publish flow:
publish-build execution.env keys onlyai publish --configure runs that guided flow without building or publishing.
Published Python runtime packages:
ai CLI and project runtime pins must come from the same release line; if
the project pins newer ai-marketplace-framework or ai-marketplace-sdk versions than
the CLI expects, upgrade ai-marketplace-cli instead of downgrading the projectmain publishes use released ai-marketplace-framework and ai-marketplace-sdk packages from the configured indexmain publishes build local SDK/framework wheels from the checked-out branch and bundle them into the source archivepublished-index[tool.uv.sources] runtime path overrides, even inside this monorepo[tool.uv.sources], run uv sync, and then retry ai pushAIMP_RUNTIME_DEPENDENCY_SOURCE_MODE=published-index or bundled-local-wheels to override branch-based defaults when neededTestPyPI and custom indexes remain advanced overrides only; the default publish path is real PyPITestPyPI or mirror those packages in another index, configure the CLI preflight with:
AIMP_PYTHON_PACKAGE_EXTRA_INDEX_URLAIMP_PYTHON_PACKAGE_INDEX_USERNAMEAIMP_PYTHON_PACKAGE_INDEX_PASSWORDTestPyPI, set only:
AIMP_PYTHON_PACKAGE_EXTRA_INDEX_URL=https://test.pypi.org/simple/PYTHON_PACKAGE_EXTRA_INDEX_URLPYTHON_PACKAGE_INDEX_USERNAMEPYTHON_PACKAGE_INDEX_PASSWORDTestPyPI, set only:
PYTHON_PACKAGE_EXTRA_INDEX_URL=https://test.pypi.org/simple/pip install, so extra-index settings are available at build time without being baked into the
final imagePlatform-owned values are never edited locally:
Examples:
ai publish
ai publish --configure
ai publish --parallel 4 --verbose
ai publish --python .venv/bin/python
ai push
ai fine-tuneFine-tune is CLI-first in V1.
ai fine-tune initai fine-tune scaffold --model <slug>bundle.json, and the CLI uploads that bundle through GatewayCommands:
ai fine-tune initai fine-tune remove --yesai fine-tune scaffold --model <slug>ai fine-tune create --model <slug> --workspace ./<slug>-fine-tuneai fine-tune listai fine-tune get --job <job_id>Examples:
ai fine-tune init
ai fine-tune scaffold --model vision-pro
python vision-pro-fine-tune/prepare_bundle.py
ai fine-tune create --model vision-pro --workspace ./vision-pro-fine-tune
ai fine-tune list --json
ai fine-tune get --job 7d2a4b2c-....
ai jobsJobs are read from the CLI only.
ai push still performs publish/build orchestration end-to-endai jobs list reads build and fine-tune jobs from one surfaceai jobs get reads a single job by explicit typeai jobs cancel cancels a jobai jobs delete removes a terminal job from historyai push now finalizes publish from the trusted remote build job; internal artifact URIs are not shown to the userExamples:
ai jobs list
ai jobs list --type build
ai jobs list --type fine-tune --status running
ai jobs list --model vision-pro --page 1 --page-size 20
ai jobs get --type build --job 7d2a4b2c-....
ai jobs get --type fine-tune --job 7d2a4b2c-....
ai jobs cancel --type build --job 7d2a4b2c-....
ai jobs delete --type fine-tune --job 7d2a4b2c-....
Interpreter precedence for contract extraction:
--pythonVIRTUAL_ENV/bin/pythonVIRTUAL_ENV/Scripts/python.exeVIRTUAL_ENV/Scripts/pythonpythonpython3Remote build troubleshooting:
ai publish does not require local Docker daemon access.ai jobs get --type build --job <job_id>.make dev-up before retrying a failed publish.ai model inspectFetch model metadata, analytics, and rates.
Examples:
ai model inspect --slug my-model
ai model inspect --id 7d2a4b2c-....
ai model inspect --slug my-model --json
By default this command prints a human-readable summary.
Use --json for machine-readable output.
ai model pullPull remote studio metadata into local files.
Writes:
.aimp/publish.tomlstudio/article.mdxstudio/cover.jpg as the default cover pathExamples:
ai model pull --slug my-model
ai model pull --id 7d2a4b2c-....
Authentication uses this precedence for API keys and explicit gateway values:
--gateway, --api-key)AIMP_GATEWAY_URL, AIMP_API_KEY)~/.aimp/config.json)If no gateway is selected by the above (for example before the first ai login, or when checking ai auth without saved credentials), the CLI fills a default gateway URL in this order:
logs/stage-runtime.json (repo-local; written by make stage-up or Quick Tunnel)STAGE_GATEWAY_PUBLIC_URL in infra/vm/stage.public.env (public, non-secret stage origin)http://localhost:8080The interactive ai login prompt uses the same default chain, except AIMP_GATEWAY_URL is applied before runtime state (see ai login above).
If ~/.aimp/config.json still points at the retired Cloud Run stage host (*.a.run.app) while
the repo public stage gateway points at the VM, ai auth prints a warning and keeps using the
saved config until you run ai login again.
Only ai login persists credentials.
ai contract edit and ai project configure manage public modes independently.
--modes accepts any non-empty comma-separated mode list--mode-inputs <mode>=<csv> and --mode-outputs <mode>=<csv> customize per-mode modalitiessearch and index are ordinary mode names; they do not imply vector accessai init scaffolds a minimal example starter with:
main.py for the public example mode and Model classplayground.py for the example Playground specruntime/ for the model runtime image filesFor local coding assistants, this CLI is the primary execution surface. MCP is not required for the local-repo workflow in this phase.
--json whenever the command supports it.agents/skills/ as the first guidance layerpyproject.toml, .aimp/project.toml, .aimp/publish.toml, and main.py before mutating the projectRecommended patterns:
ai contract validate --json
ai contract show --json
ai model inspect --slug my-model --json
ai publish --configure --json
These commands support --json:
ai initai loginai authai logoutai publishai pushai model inspectai model pullai jobs listai jobs getai fine-tune createai fine-tune listai fine-tune getJSON success payloads use:
{
"ok": true,
"request_id": "cli-...",
"data": {}
}
JSON error payloads use:
{
"ok": false,
"request_id": "cli-...",
"error": {
"code": "gateway_unreachable",
"category": "network",
"message": "Authentication failed: gateway unreachable",
"retryable": true,
"exit_code": 5
}
}
Debug logs from --debug are written to stderr.
0: success or expected status result2: usage or local config validation error3: authentication or permission failure4: local environment or dependency failure5: network or downstream service failure6: remote conflict, quota, or not-found state130: interruptedcd cli
uv run ruff check .
uv run --extra dev mypy aimp_cli tests
uv run pytest
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 2.2.23 | 2 May 2026 | 12 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:14 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:b4bf92fe03c38ab8e3af0cae13bb05dacb5b82b04882ced71b8070c686d071bd