AgentSkillsCN

configuring-resources

为 inference.sh 应用配置 inf.yml 文件。当您需要设置 GPU、显存、内存、分类标签、环境变量、packages.txt 文件、密钥、集成服务,或指定资源需求时,可使用此技能。

SKILL.md
--- frontmatter
name: configuring-resources
description: Configure inf.yml for inference.sh apps. Use when setting GPU, VRAM, RAM, categories, environment variables, packages.txt, secrets, integrations, or resource requirements.

Configuring Resources (inf.yml)

The inf.yml file defines app settings and resource requirements.

Project Structure

code
my-app/
├── inf.yml           # Configuration
├── inference.py      # App logic
├── requirements.txt  # Python packages (pip)
└── packages.txt      # System packages (apt) — optional

inf.yml Structure

yaml
name: my-app
description: What my app does
category: image
kernel: python-3.11

resources:
  gpu:
    count: 1
    vram: 24    # 24GB (auto-converted)
    type: any
  ram: 32       # 32GB

env:
  MODEL_NAME: gpt-4
  HF_HUB_ENABLE_HF_TRANSFER: "1"

Resource Units

CLI auto-converts human-friendly values:

  • < 1000 → GB (e.g., 80 = 80GB)
  • 1000 to 1B → MB

GPU Types

any | nvidia | amd | apple | none

Note: Currently only NVIDIA CUDA GPUs are supported.

Categories

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

CPU-Only Apps

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

Secrets

Declare required secrets:

yaml
secrets:
  - key: HF_TOKEN
    description: HuggingFace token for gated models
    optional: false

Integrations

Declare OAuth integrations:

yaml
integrations:
  - key: google.sheets
    description: Access to Google Sheets
    optional: true

Dependencies

Python Packages (requirements.txt)

code
torch>=2.0
transformers
accelerate

System Packages (packages.txt)

For apt-installable dependencies:

code
ffmpeg
libgl1-mesa-glx

Base Images

TypeImage
GPUdocker.inference.sh/gpu:latest-cuda
CPUdocker.inference.sh/cpu:latest