# Apps

> Apps are tools that do one thing well.

**URL:** https://inference.sh/docs/concepts/apps
**Last updated:** 2026-10-11

---

Apps are tools that do one thing well.

---

## What's an app?

An app takes input, does something, and returns output.

**Examples:**
- `stable-diffusion` — prompt in, image out
- `whisper` — audio in, text out
- `summarize` — long text in, short text out
- `router` (decision) — state plus typed questions in, probability per answer out

---

## Inputs and outputs

Every app has a schema:

```
stable-diffusion
├── Input
│   ├── prompt (text, required)
│   ├── style (text, optional)
│   └── size (choice, optional)
└── Output
    └── image (file)
```

The schema tells you what to provide and what you'll get back.

### Decision apps

**Decision** apps answer structured questions about a piece of state (and optionally images or videos) and return a **probability distribution** over each answer — not generated media. Set `category: decision` in `inf.yml` ([Configuration — Categories](/docs/extend/configuration#categories)).

The wire contract matches the generated SDK types `DecisionInput` / `DecisionOutput` (and `DecisionVisionInput` when images are included, or `DecisionVideoInput` when videos are included as well; the Python helper ships in `inferencesh` ≥ v0.23.0). Question kinds:

| Kind | Input field | What you ask | Output field |
|------|-------------|--------------|--------------|
| **Choice** | `choices[]` | Which one of a fixed set of named options applies | `choices` — map keyed by question `id` |
| **Score** | `scores[]` | Where the state sits on ordered levels (low → high) | `scores` — map keyed by question `id` |
| **Noul** | `nouls[]` | Probability that something is true (yes/no) | `nouls` — map keyed by question `id` |

Each question has an `id` (your key), `instructions` (what the model should consider), and kind-specific fields (`options` for choices, `levels` for scores, optional `criteria` for nouls). `state` is arbitrary JSON the model reads alongside the questions. Vision models add `images` — file URIs every question can see.

Example input:

```json
{
  "state": { "ticket": "Payment failed after card update", "channel": "email" },
  "choices": [
    {
      "id": "intent",
      "instructions": "What is the customer trying to do?",
      "options": [
        { "name": "refund", "description": "Get money back" },
        { "name": "retry", "description": "Retry the charge" }
      ]
    }
  ],
  "nouls": [
    {
      "id": "urgent",
      "instructions": "Does this need same-day handling?",
      "criteria": { "true": "Same-day SLA applies", "false": "Standard queue" }
    }
  ]
}
```

Example output (shape every decision app returns):

```json
{
  "choices": {
    "intent": {
      "choice": "retry",
      "confidence": 0.72,
      "probabilities": { "refund": 0.28, "retry": 0.72 }
    }
  },
  "nouls": {
    "urgent": { "noul": 0.41 }
  },
  "scores": {},
  "model": "myteam/support-router",
  "input_tokens": 1842
}
```

- **Choice** answers include the highest-probability `choice`, `confidence`, and `probabilities` for every option name.
- **Score** answers include `score` (0 through the top level index), `normalized` (0–1), `confidence`, per-level `probabilities`, and a `legend` mapping level numbers to descriptions.
- **Noul** answers expose `noul` as the probability the statement is true.

Run decision apps like any other app (`client.tasks.create`, Flows, or the workspace UI). TypeScript types: [JavaScript SDK — Decision app types](/docs/api/sdk-javascript#decision-app-types).

---

## Where apps come from

| Source | Description |
|--------|-------------|
| **The Grid** | 100+ pre-built apps from inference shell (image, audio, text, and more) |
| **Community** | Public apps from other users |
| **You** | Apps you create and deploy |

Each app has a **category** (for example `image`, `chat`, or `decision` for the shared [decision contract](/docs/extend/app-code#decision-models-contract)) and optional **tags** — lowercase slugs such as `text-to-image` or `open-weights` that describe what it does and how it behaves. Tags feed search and store listings. → [Configuration — App tags](/docs/extend/configuration#app-tags) · [Apps API](/docs/api/rest/apps#app-tags)

**Apps vs connector tools:** The Grid is the library of runnable **apps** (each with typed inputs and outputs). Agents can also call **external integrations** (Gmail, Slack, Linear, and more) as connector tools — see [Tool Orchestration](/docs/runtime/tool-orchestration) and [Connectors](/docs/connectors/overview).

---

## How to use apps

1. **Directly** — Run from the workspace UI
2. **In Flows** — Chain with other apps
3. **As Agent Tools** — Let agents call them
4. **Via API** — Run programmatically

## Creating Apps

You can create your own apps using Python. An app consists of:

1.  `inference.py` — The code
2.  `inf.yml` — Configuration

### Code Structure

```python
class AppSetup(BaseAppInput):
    """Static configuration (restart required)"""
    model_name: str

class AppInput(BaseAppInput):
    """Request arguments (per run)"""
    prompt: str

class App(BaseApp):
    async def setup(self, config: AppSetup):
        # Load heavy resources
        pass

    async def run(self, input: AppInput):
        # Process request
        pass
```

---

## Next

→ [Tasks](/docs/concepts/tasks)
