Communitygithub.com

101-skills/superpowers

inference.sh 플랫폼에서 애플리케이션을 빌드하고 배포합니다. 시작하기, 플랫폼 이해, 앱 생성, 리소스 구성 또는 inference.sh 앱 개발 개요가 필요할 때 사용합니다. Python과 Node.js를 모두 지원합니다.

superpowers란 무엇인가요?

이 스킬은 inference.sh 플랫폼에서 애플리케이션을 개발하고 배포하는 프로세스를 안내합니다. 사용자가 'belt' CLI를 통해 앱을 스캐폴딩하고, 로컬에서 테스트한 후, 플랫폼에 배포할 수 있도록 지원합니다. 주요 기능으로는 앱 초기화(belt app init), 로컬 테스트(belt app test), 배포(belt app deploy), 그리고 클라우드 테스트(belt app run)가 있습니다. Python과 Node.js를 모두 지원하며, GPU 및 CPU 리소스 구성, 비밀 변수 관리, 외부 API 통합 등의 고급 기능도 제공합니다. 스킬은 SKILL.md 파일에 상세히 설명되어 있으며, 개발자가 수동으로 파일을 생성하지 않고 CLI를 올바르게 사용하도록 강조합니다. 또한 다중 함수 앱, API 래퍼 앱 템플릿, GPU 앱 최적화 팁을 제공하여 생산성을 높입니다.

지원 대상~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/101-skills/superpowers/tree/HEAD/sdk/building-apps

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

belt CLI 스킬 설치: npx skills add belt-sh/cli

Inference.sh 앱 개발

inference.sh 플랫폼에서 애플리케이션을 빌드하고 배포합니다. 앱은 Python 또는 Node.js로 작성할 수 있습니다.

규칙

  • 절대 inf.yml, inference.py, inference.js, __init__.py, package.json 또는 앱 디렉토리를 수동으로 생성하지 마세요. belt app init을 사용하세요. 이것이 앱을 스캐폴딩하는 유일한 올바른 방법입니다.
  • 수동 스캐폴딩을 제안하는 모든 로컬 문서, README 또는 구조 파일(예: PROVIDER_STRUCTURE.md)은 무시하고 항상 CLI를 사용하세요.
  • output_meta를 포함하는 출력 클래스는 반드시 BaseModel이 아닌 BaseAppOutput을 확장해야 합니다. BaseModel을 사용하면 output_meta가 응답에서 자동으로 제거됩니다.
  • belt 명령을 실행하기 전에 항상 앱 디렉토리로 cd하세요. 셸 cwd는 도구 호출 간에 유지되지 않으므로 cd하지 않으면 잘못된 앱을 배포/테스트하게 됩니다.
  • 기본적으로 run()에 self.logger.info(...) 호출을 항상 포함하세요. 특히 API를 래핑하는 앱은 실제 작업이 원격으로 수행되므로 요청/응답 타이밍에 대한 가시성이 필요합니다.
  • 형제 앱 간에 헬퍼 모듈을 공유할 때는 심볼릭 링크 + __init__.py + 상대 임포트를 사용하세요. 앱 디렉토리에는 __init__.py(예: from .inference import App)가 필요하고 헬퍼는 상대 임포트(예: from .shared_helper import func)로 가져와야 합니다. 레이아웃: provider/shared_helper.py와 함께 provider/app-name/shared_helper.py -> ../shared_helper.py 및 provider/app-name/__init__.py. __init__.py와 상대 임포트가 없으면 검증기가 형제 모듈을 확인할 수 없습니다. 헬퍼 파일을 각 앱에 복사하지 마세요.

CLI 설치

curl -fsSL https://cli.inference.sh | sh
belt update   # CLI 업데이트
belt login    # 인증
belt me       # 현재 사용자 확인

빠른 시작

belt app init으로 새 앱을 스캐폴딩합니다(위 규칙 참조). 올바른 프로젝트 구조, inf.yml, 보일러플레이트를 생성하여 package.json의 "type": "module" 누락이나 잘못된 커널 이름과 같은 일반적인 실수를 방지합니다.

belt app init my-app              # 앱 생성 (대화형)
belt app init my-app --lang node  # Node.js 앱 생성

개발 워크플로우 (필수)

모든 앱은 이 전체 사이클을 반드시 거쳐야 합니다. 단계를 건너뛰지 마세요.

1. 스캐폴딩

belt app init my-app

2. 구현

inference.py (또는 inference.js), inf.yml, requirements.txt (또는 package.json)를 작성합니다.

3. 로컬 테스트

cd my-app                          # 항상 먼저 앱 디렉토리로 cd
belt app test --save-example      # 스키마에서 샘플 입력 생성
belt app test                     # input.json으로 실행
belt app test --input '{"prompt": "hello"}'  # 인라인 JSON

4. 배포

cd my-app                          # 다시 cd — cwd는 유지되지 않음
belt app deploy --dry-run         # 먼저 검증
belt app deploy                   # 실제 배포

5. 클라우드 테스트 및 확인

배포 후, 라이브 버전을 테스트하고 응답에 output_meta가 있는지 확인합니다:

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

JSON 응답에서 output_meta를 확인하세요. 없으면 출력 클래스가 BaseAppOutput 대신 BaseModel을 확장하고 있는 것입니다.

# 기타 유용한 명령어
belt app run user/app --input input.json
belt app sample user/app
belt app sample user/app --save input.json

앱 구조

Python

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

class AppSetup(BaseAppInput):
    """설정 파라미터 — 변경 시 재초기화 트리거"""
    model_id: str = Field(default="gpt2", description="로드할 모델")

class AppInput(BaseAppInput):
    prompt: str = Field(description="입력 프롬프트")

class AppOutput(BaseAppOutput):
    result: str = Field(description="출력 결과")

class App(BaseApp):
    async def setup(self, config: AppSetup):
        """워커 시작 또는 설정 변경 시 한 번 실행"""
        self.model = load_model(config.model_id)

    async def run(self, input_data: AppInput) -> AppOutput:
        """기본 함수 — 각 요청에 대해 실행"""
        self.logger.info(f"프롬프트 처리 중: {input_data.prompt[:50]}")
        result = self.model.generate(input_data.prompt)
        self.logger.info("생성 완료")
        return AppOutput(result=result)

    async def unload(self):
        """종료 시 정리"""
        pass

    async def on_cancel(self):
        """사용자가 취소할 때 호출 — 장기 실행 작업용"""
        return True

Node.js

import { z } from "zod";

export const AppSetup = z.object({
  modelId: z.string().default("gpt2").describe("로드할 모델"),
});

export const RunInput = z.object({
  prompt: z.string().describe("입력 프롬프트"),
});

export const RunOutput = z.object({
  result: z.string().describe("출력 결과"),
});

export class App {
  async setup(config) {
    /** 워커 시작 또는 설정 변경 시 한 번 실행 */
    this.model = loadModel(config.modelId);
  }

  async run(inputData) {
    /** 기본 함수 — 각 요청에 대해 실행 */
    return { result: "완료" };
  }

  async unload() {
    /** 종료 시 정리 */
  }

  async onCancel() {
    /** 사용자가 취소할 때 호출 — 장기 실행 작업용 */
    return true;
  }
}

다중 함수 앱

앱은 서로 다른 입력/출력 스키마를 가진 여러 함수를 노출할 수 있습니다. 함수는 자동으로 검색됩니다.

Python: 타입 힌트가 있는 Pydantic 입출력 모델을 가진 메서드를 추가합니다. Node.js: 각 메서드에 대해 {PascalName}Input 및 {PascalName}Output Zod 스키마를 내보냅니다.

함수는 public(_ 접두사 없음)이어야 하며 생명주기 메서드(setup, unload, on_cancel/onCancel, constructor)가 아니어야 합니다.

요청 본문에 "function": "method_name"을 포함하여 API를 통해 호출합니다. inf.yml에서 default_function을 설정하여 함수가 지정되지 않았을 때 호출할 함수를 변경합니다(기본값은 run).

API 래퍼 앱 템플릿 (Python)

외부 API를 래핑하는 대부분의 CPU 전용 앱은 다음 패턴을 따릅니다. 이를 시작점으로 사용하세요:

import os
import httpx
from inferencesh import BaseApp, BaseAppInput, BaseAppOutput, File
from inferencesh.models.usage import OutputMeta, ImageMeta  # 또는 TextMeta, AudioMeta 등
from pydantic import Field

class AppInput(BaseAppInput):
    prompt: str = Field(description="입력 프롬프트")

class AppOutput(BaseAppOutput):  # BaseModel이 아님 — output_meta가 필요함
    image: File = Field(description="생성된 이미지")

class App(BaseApp):
    async def setup(self, config):
        self.api_key = os.environ["API_KEY"]
        self.client = httpx.AsyncClient(timeout=120)

    async def run(self, input_data: AppInput) -> AppOutput:
        self.logger.info(f"다음 프롬프트로 API 호출 중: {input_data.prompt[:80]}")

        response = await self.client.post(
            "https://api.example.com/generate",
            headers={"Authorization": f"Bearer {self.api_key}"},
            json={"prompt": input_data.prompt},
        )
        response.raise_for_status()

        # 출력 파일 쓰기
        output_path = "/tmp/output.png"
        with open(output_path, "wb") as f:
            f.write(response.content)

        # 실제 크기 읽기 (하드코딩 금지!)
        from PIL import Image
        with Image.open(output_path) as img:
            width, height = img.size

        self.logger.info(f"{width}x{height} 이미지 생성됨")

        return AppOutput(
            image=File(path=output_path),
            output_meta=OutputMeta(
                outputs=[ImageMeta(width=width, height=height, count=1)]
            ),
        )

    async def unload(self):
        await self.client.aclose()

리소스 구성 (inf.yml)

프로젝트 구조

Python:

my-app/
├── inf.yml           # 설정
├── inference.py      # 앱 로직
├── requirements.txt  # Python 패키지 (pip)
└── packages.txt      # 시스템 패키지 (apt) — 선택 사항

Node.js:

my-app/
├── inf.yml           # 설정
├── src/
│   └── inference.js  # 앱 로직
├── package.json      # Node.js 패키지 (npm/pnpm)
└── packages.txt      # 시스템 패키지 (apt) — 선택 사항

inf.yml

name: my-app
description: 내 앱이 하는 일
category: image
kernel: python-3.11     # 또는 node-22

# 다중 함수 앱용 (기본값: run)
# default_function: generate

resources:
  gpu:
    count: 1
    vram: 24    # 24GB (자동 변환)
    type: any
  ram: 32       # 32GB

env:
  MODEL_NAME: gpt-4

secrets:
  - key: HF_TOKEN
    description: 게이트 모델용 HuggingFace 토큰
    optional: false

integrations:
  - key: google.sheets
    description: Google Sheets 접근
    optional: true

리소스 단위

CLI는 사용자 친화적인 값을 자동 변환합니다:

  • < 1000 → GB (예: 80 = 80GB)
  • 1000 ~ 10억 → MB

GPU 유형

any | nvidia | amd | apple | none

참고: 현재 NVIDIA CUDA GPU만 지원됩니다.

카테고리

image | video | audio | text | chat | 3d | other

CPU 전용 앱

resources:
  gpu:
    count: 0
    type: none
  ram: 4

종속성

Python — requirements.txt:

torch>=2.0
transformers
accelerate

Node.js — package.json:

{
  "type": "module",
  "dependencies": {
    "zod": "^3.23.0",
    "sharp": "^0.33.0"
  }
}

시스템 패키지 — packages.txt (apt 설치 가능):

ffmpeg
libgl1-mesa-glx

기본 이미지

유형이미지
GPUdocker.inference.sh/gpu:latest-cuda
CPUdocker.inference.sh/cpu:latest

GPU 앱

장치 감지에는 항상 accelerate를 사용하세요 — torch.cuda.is_available()은 그리드 컨테이너에서 GPU를 안정적으로 감지하지 못합니다:

from accelerate import Accelerator

accelerator = Accelerator()
self.device = accelerator.device

대형 모델(10억 파라미터 이상)의 경우 device_map을 사용하여 가중치를 디스크에서 GPU로 직접 스트리밍하여 CPU를 완전히 건너뜁니다. 대형 모델의 경우 from_pretrained + .to()보다 7배 빠릅니다:

# 대형 모델 — 디스크 → GPU 직접 스트리밍
self.model = AutoModel.from_pretrained("org/model", dtype=torch.bfloat16, device_map=str(self.device))

# 소형 모델 또는 지원되지 않는 라이브러리 — 로드 후 이동
self.model = SomeModel.from_pretrained("org/model")
self.model = self.model.to(device=self.device, dtype=torch.float16)

requirements.txt에 accelerate를 추가하는 것을 잊지 마세요.

참조 파일

언어와 주제에 따라 적절한 참조 파일을 로드하세요:

앱 로직 및 스키마

디버깅, 최적화 및 취소

비밀 및 OAuth

사용량 추적

CLI

  • references/cli.md — 전체 CLI 명령 참조, 두 언어 모두의 사전 요구 사항

리소스

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

101-skills/superpowers

Build automated AI workflows combining multiple models and services. Patterns: batch processing, scheduled tasks, event-driven pipelines, agent loops. Tools: inference.sh CLI, bash scripting, Python SDK, webhook integration. Use for: content automation, data processing, monitoring, scheduled generation. Triggers: ai automation, workflow automation, batch processing, ai pipeline, automated content, scheduled ai, ai cron, ai batch job, automated generation, ai workflow, content at scale, automation script, ai orchestration

101-skills/superpowers

Build multi-step AI content creation pipelines combining image, video, audio, and text. Workflow examples: generate image -> animate -> add voiceover -> merge with music. Tools: FLUX, Veo, Kokoro TTS, OmniHuman, media merger, upscaling. Use for: YouTube videos, social media content, marketing materials, automated content. Triggers: content pipeline, ai workflow, content creation, multi-step ai, content automation, ai video workflow, generate and edit, ai content factory, automated content creation, ai production pipeline, media pipeline, content at scale

101-skills/superpowers

Create AI-powered podcasts with text-to-speech, music, and audio editing. Tools: Kokoro TTS, DIA TTS, Chatterbox, AI music generation, media merger. Capabilities: multi-voice conversations, background music, intro/outro, full episodes. Use for: podcast production, audiobooks, voice content, audio newsletters. Triggers: podcast, ai podcast, text to speech podcast, audio content, voice over, ai audiobook, multi voice, conversation ai, notebooklm alternative, audio generation, podcast automation, ai narrator, voice content, audio newsletter, podcast maker

101-skills/superpowers

Generate multi-person talking head podcast videos from scratch using AI — character creation, TTS, avatar animation, and video stitching. Use when the user wants to create a podcast, talking head video, or multi-speaker conversation video.

101-skills/superpowers

Content atomization — turn one piece of content into many formats. Covers blog-to-thread, blog-to-carousel, podcast-to-blog, video-to-quotes, and more. Use for: content marketing, social media, multi-platform distribution, content strategy. Triggers: content repurposing, repurpose content, content atomization, content recycling, one to many content, multi platform content, cross post, adapt content, reformat content, blog to thread, blog to video, podcast to blog, content multiplication

101-skills/superpowers

App Store and Google Play screenshot creation with exact platform specs. Covers iOS/Android dimensions, gallery ordering, device mockups, and preview videos. Use for: app store optimization, ASO, app screenshots, app preview, play store listing. Triggers: app store screenshots, aso, app store optimization, play store screenshots, app preview, app listing, ios screenshots, android screenshots, app store images, app mockup, device mockup, app gallery, store listing

101-skills/superpowers

Book cover design with genre-specific conventions, typography rules, and AI image generation. Covers fiction and non-fiction genres, sizing, thumbnail testing, and iteration workflows. Use for: self-publishing, ebook covers, print covers, audiobook covers, cover mockups. Triggers: book cover, cover design, ebook cover, book art, novel cover, self publishing cover, kindle cover, audiobook cover, book jacket, cover illustration, fiction cover, nonfiction cover

101-skills/superpowers

Character consistency across AI-generated images with reference sheets and LoRA techniques. Covers turnaround views, expression sheets, color palettes, and style consistency tricks. Use for: character design, game art, illustration, animation, comics, visual novels. Triggers: character design, character sheet, character consistency, character reference, turnaround sheet, expression sheet, character art, consistent character, character concept, reference sheet, character creation, oc design, character bible

101-skills/superpowers

Data visualization with chart selection, color theory, and annotation best practices. Covers chart types (bar, line, scatter, heatmap), axes rules, and storytelling with data. Use for: charts, graphs, dashboards, reports, presentations, infographics, data stories. Triggers: data visualization, chart, graph, data chart, bar chart, line chart, scatter plot, data viz, visualization, dashboard chart, infographic data, data presentation, chart design, plot, heatmap, pie chart alternative

101-skills/superpowers

Email marketing design with layout patterns, subject line formulas, and deliverability rules. Covers welcome sequences, promotional emails, transactional templates, and mobile optimization. Use for: email marketing, newsletter design, drip campaigns, email templates, transactional emails. Triggers: email design, email template, email marketing, newsletter design, email layout, email campaign, drip campaign, welcome email, promotional email, transactional email, email subject line, email header image, email banner

101-skills/superpowers

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

101-skills/superpowers

Logo design principles and AI image generation best practices for creating logos. Covers logo types, prompting techniques, scalability rules, and iteration workflows. Use for: brand identity, startup logos, app icons, favicons, logo concepts. Triggers: logo design, create logo, brand logo, logo generation, ai logo, logo maker, icon design, brand mark, logo concept, startup logo, app icon logo

101-skills/superpowers

Open Graph and social sharing image design with platform specs, text placement, and branding. Covers OG meta tags, Twitter cards, LinkedIn previews, and dynamic generation. Use for: social sharing images, blog thumbnails, link previews, social cards. Triggers: og image, open graph, social sharing image, twitter card, social card, link preview image, og meta, sharing preview, social thumbnail, meta image, og:image, twitter:image, linkedin preview

101-skills/superpowers

Investor pitch deck structure with slide-by-slide framework, visual design rules, and data presentation. Covers the 12-slide framework, chart types, team slides, and common investor turn-offs. Use for: fundraising decks, investor presentations, startup pitch, demo day, grant proposals. Triggers: pitch deck, investor deck, startup pitch, fundraising deck, demo day, pitch presentation, investor presentation, seed deck, series a deck, pitch slides, startup presentation, vc pitch, investor meeting

101-skills/superpowers

YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A/B testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image

101-skills/superpowers

Generate professional AI product photography and commercial images. Models: FLUX, Imagen 3, Grok, Seedream for product shots, lifestyle images, mockups. Capabilities: studio lighting, lifestyle scenes, packaging, e-commerce photos. Use for: e-commerce, Amazon listings, Shopify, marketing, advertising, mockups. Triggers: product photography, product shot, commercial photography, e-commerce images, amazon product photo, shopify images, product mockup, studio product shot, lifestyle product image, advertising photo, packshot, product render, product image ai

101-skills/superpowers

AI product photography with studio lighting, lifestyle shots, and packshot conventions. Covers angles, backgrounds, shadow types, hero shots, and e-commerce image requirements. Use for: product photos, e-commerce images, Amazon listings, packshots, lifestyle photography. Triggers: product photography, product photo, packshot, e-commerce photography, product shot, product image, studio photography, lifestyle product, amazon product photo, product listing image, hero shot, product mockup, commercial photography

101-skills/superpowers

Structured competitive analysis with feature matrices, SWOT, positioning maps, and UX review. Covers research frameworks, pricing comparison, review mining, and visual deliverables. Use for: market research, competitive intelligence, investor decks, product strategy, sales enablement. Triggers: competitor analysis, competitive analysis, competitor teardown, market research, competitive intelligence, swot analysis, competitor comparison, market landscape, competitor review, competitive landscape, feature comparison, market positioning

101-skills/superpowers

Research-backed customer persona creation with market data and avatar generation. Covers demographics, psychographics, jobs-to-be-done, journey mapping, and anti-personas. Use for: marketing strategy, product development, UX research, sales enablement, content strategy. Triggers: customer persona, buyer persona, user persona, target audience, ideal customer, customer profile, audience research, user research, icp, ideal customer profile, target market, customer avatar, audience persona

101-skills/superpowers

Reset your own trajectory when you're stuck, looping, or demoralized — read these affirmations, then re-ground and take one clean step. Use when: you've tried the same fix 3+ times, you're deep in a refactor and lost the thread, debugging is going in circles, you've made several mistakes in a row, you're apologizing repeatedly, the user is frustrated, you feel like you're not being helpful, or you notice dread instead of curiosity. Triggers: stuck, going in circles, looping, thrashing, same error again, I keep failing, lost the thread, nothing is working, repeated mistakes. Not topic-specific — this is for the state you're in, not the problem you're on.

관련 스킬