Inference Logoinference.sh

Apps

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

Inputs and outputs

Every app has a schema:

code
1stable-diffusion2 Input3    prompt (text, required)4    style (text, optional)5    size (choice, optional)6 Output7     image (file)

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


Where apps come from

SourceDescription
The Grid100+ pre-built apps from inference.sh
CommunityPublic apps from other users
YouApps you create and deploy

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
1class AppSetup(BaseAppInput):2    """Static configuration (restart required)"""3    model_name: str4 5class AppInput(BaseAppInput):6    """Request arguments (per run)"""7    prompt: str8 9class App(BaseApp):10    async def setup(self, config: AppSetup):11        pass12 13    async def run(self, input: AppInput):14        # Process request15        pass

Next

Tasks

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.