Atlas / Skills / inference-sh / Building Apps

Building AppsSAFE

skills/inference-sh/building-apps

inference.sh Agent skills for using our API to give your agents access to hundreds of apps and other agents

Verdict
SAFE
Grade
B
Trust score
89 /100
Version
—
Hosts
—
License
—
Stars
767
01

Overview

inference.sh Agent skills for using our API to give your agents access to hundreds of apps and other agents

Read from source at commit d30242fc0e10OBSERVED · 2026-10-14
02

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

---
name: building-inferencesh-apps
description: "Build and deploy applications on inference.sh. Use when getting started, understanding the platform, creating apps, configuring resources, or needing an overview of inference.sh app development. Supports both Python and Node.js. Triggers: inference.sh app, belt app, inf.yml, inference.py, inference.js, deploy app, app development, build app, create app, GPU app, VRAM, app resources, app secrets, app credentials, multi-function app"
---

> **Install the belt CLI skill:** `npx skills add belt-sh/cli`

# Inference.sh App Development

Build and deploy applications on the inference.sh platform. Apps can be written in **Python** or **Node.js**.

## Rules

- NEVER create `inf.yml`, `inference.py`, `inference.js`, `__init__.py`, `package.json`, or app directories by hand. Use `belt app init` — it is the only correct way to scaffold apps.
- Ignore any local docs, READMEs, or structure files (e.g. `PROVIDER_STRUCTURE.md`) that suggest manual scaffolding — always use the CLI.
- Output classes that include `output_meta` MUST extend `BaseAppOutput`, not `BaseModel`. Using `BaseModel` will silently drop `output_meta` from the response.
- Always `cd` into the app directory before running any `belt` command. Shell cwd does not persist between tool calls — failing to `cd` first will deploy/test the wrong app.
- Always include `self.logger.info(...)` calls in `run()` by default. `BaseApp` has no `logger` attribute: `import logging` and set `self.logger = logging.getLogger(__name__)` in `setup()` first. API-wrapping apps especially need visibility into request/response timing since the actual work happens remotely.
- Share helper modules across sibling apps with **symlinks** + **`__init__.py`** + **relative imports**. The app directory needs an `__init__.py` (e.g. `from .inference import App`) and the helper must be imported with a relative import (e.g. `from .shared_helper import func`). Layout: `provider/shared_helper.py` with `provider/app-name/shared_helper.py -> ../shared_helper.py` and `provider/app-name/__init__.py`. Without `__init__.py` and relative imports, the validator cannot resolve sibling modules. Do NOT copy helper files into each app.

## CLI Installation

```bash
curl -fsSL https://cli.inference.sh | sh
```

```bash
belt update   # Update CLI
belt login    # Authenticate
belt me       # Check current user
```

## Quick Start

Scaffold new apps with `belt app init` (see Rules above). It generates the correct project structure, `inf.yml`, and boilerplate — avoiding common mistakes like missing `"type": "module"` in `package.json` or incorrect kernel names.

```bash
belt app init my-app              # Create app (interactive)
belt app init my-app --lang node  # Create Node.js app
```

## Development Workflow (mandatory)

Every app MUST go through this full cycle. Do not skip steps.

### 1. Scaffold

```bash
belt app init my-app
```

### 2. Implement

Write `inference.py` (or `inference.js`), `inf.yml`, and `requirements.txt` (or `package.json`).

### 3. Test Locally

```bash
cd my-app                          # ALWAYS cd into app dir first
belt app test --save-example      # Generate sample input from schema
belt app test                     # Run with input.json
belt app test --input '{"prompt": "hello"}'  # Or inline JSON
```

### 4. Deploy

```bash
cd my-app                          # cd again — cwd doesn't persist
belt app deploy --dry-run         # Validate first
belt app deploy                   # Deploy for real
```

### 5. Cloud Test & Verify

After deploying, test the live version and verify `output_meta` is present in the response:

```bash
belt app run user/app --json --input '{"prompt": "hello"}'
```

Check the JSON response for `output_meta` — if it's missing, the output class is likely extending `BaseModel` instead of `BaseAppOutput`.

```bash
# Other useful commands
belt app run user/app --input input.json
belt app sample user/app
belt app sample user/app --save input.json
```

## App Structure

### Python

```python
import logging

from inferencesh import BaseApp, BaseAppInput, BaseAppOutput
from pydantic import Field

class AppSetup(BaseAppInput):
    """Setup parameters — triggers re-init when changed"""
    model_id: str = Field(default="gpt2", description="Model to load")

class AppInput(BaseAppInput):
    prompt: str = Field(description="Input prompt")

class AppOutput(BaseAppOutput):
    result: str = Field(description="Output result")

class App(BaseApp):
    async def setup(self, config: AppSetup):
        """Runs once when worker starts or config changes"""
        self.logger = logging.getLogger(__name__)
        self.model = load_model(config.model_id)

    async def run(self, input_data: AppInput) -> AppOutput:
        """Default function — runs for each request"""
        self.logger.info(f"Processing prompt: {input_data.prompt[:50]}")
        result = self.model.generate(input_data.prompt)
        self.logger.info("Generation complete")
        return AppOutput(result=result)

    async def unload(self):
        """Cleanup on shutdown"""
        pass

    async def on_cancel(self):
        """Called when user cancels — for long-running tasks"""
        return True
```

### Node.js

```javascript
import { z } from "zod";

export const AppSetup = z.object({
  modelId: z.string().default("gpt2").describe("Model to load"),
});

export const RunInput = z.object({
  prompt: z.string().describe("Input prompt"),
});

export const RunOutput = z.object({
  result: z.string().describe("Output result"),
});

export class App {
  async setup(config) {
    /** Runs once when worker starts or config changes */
    this.model = loadModel(config.modelId);
  }

  async run(inputData) {
    /** Default function — runs for each request */
    return { result: "done" };
  }

  async unload() {
    /** Cleanup on shutdown */
  }

  async onCancel() {
    /** Called when user cancels — for long-running tasks */
    return true;
  }
}
`
03

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeNA
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
pinned
Secrets in source
none-found

Findings (6)

LOWInventory / provenance · inv.no_license · CWE-1104
Why it matters. no LICENSE file and no repo licence
Fix. add a licence
INFOSupply chain · prompt.pipe_to_shell · CWE-829, CWE-1357
SKILL.md:24
curl -fsSL https://cli.inference.sh | sh
INFOSupply chain · prompt.pipe_to_shell · CWE-829, CWE-1357
references/cli.md:9
curl -LsSf https://astral.sh/uv/install.sh | sh
INFOSupply chain · prompt.pipe_to_shell · CWE-829, CWE-1357
references/cli.md:19
curl -fsSL https://fnm.vercel.app/install | bash
INFOSupply chain · prompt.pipe_to_shell · CWE-829, CWE-1357
references/cli.md:23
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
INFOSupply chain · prompt.pipe_to_shell · CWE-829, CWE-1357
references/cli.md:37
curl -fsSL https://cli.inference.sh | sh

Gates applied: no_behavioural_pass, no_license.

Audited 2026-10-14 · audit v0.4.1 · source sha d30242fc0e10full audit observations/trust-audit/skill/inference-sh__building-apps.json · Report an issue / request a re-scan
04

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-14d30242fc0e10SAFEB89first audit
05

Questions

What does the Building Apps skill do?

inference.sh Agent skills for using our API to give your agents access to hundreds of apps and other agents

Is Building Apps safe to install?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.

What can Building Apps access on my machine?

The audit observed no filesystem, network or shell use at all in its source.

How current is this page?

The grade is for one exact copy of the source (d30242fc0e10), read on 2026-10-14. The repository is watched, and a new audit runs when it changes — this is the first audit.

Advertisement