一键导入
os-model-research
Research an open-source model repository and produce a structured specification for building a Griptape Nodes library.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Research an open-source model repository and produce a structured specification for building a Griptape Nodes library.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create a Griptape Nodes library wrapping an open-source model repository. Takes an OS model repo URL and library repo path (already created from the template).
Set up a Griptape Nodes library structure for an OS model. Renames directories, adds the OS model as a git submodule, creates the advanced library file, and updates all configuration files.
Implement Griptape Nodes wrapping an OS model's features, based on a spec file. Creates node Python files, registers them in the manifest, and runs lint checks.
| name | os-model-research |
| description | Research an open-source model repository and produce a structured specification for building a Griptape Nodes library. |
| argument-hint | <os-model-repo-url> <library-repo-path> |
| allowed-tools | Bash Read Write Grep Glob WebFetch |
| disable-model-invocation | false |
Analyze an open-source model repository and produce a structured spec file that the library setup and node implementation phases will consume.
Extract from $ARGUMENTS:
https://github.com/facebookresearch/sam3/Users/me/nodes/griptape-nodes-library-sam3If either is missing, stop and ask the user.
Derive the model short name from the repo URL (the last path segment, lowercased):
https://github.com/facebookresearch/sam3 -> sam3https://github.com/ByteDance-Seed/depth-anything-3 -> depth-anything-3Create the scratch directory inside the library repo:
mkdir -p <library-repo-path>/.scratch/os-model-spec-<model-name>
Ensure .scratch/ is in the library repo's .gitignore. If .gitignore does not exist or does not contain .scratch/, add it:
grep -q '\.scratch/' <library-repo-path>/.gitignore 2>/dev/null || echo '.scratch/' >> <library-repo-path>/.gitignore
Fetch the GitHub repo page to get the description, topics, and README:
WebFetch: https://github.com/<owner>/<repo>
Also fetch the raw README (try both):
WebFetch: https://raw.githubusercontent.com/<owner>/<repo>/main/README.md
WebFetch: https://raw.githubusercontent.com/<owner>/<repo>/master/README.md
Extract: what the model does, its primary domain (image/video/audio/text), usage examples, installation instructions, and any HuggingFace model links.
Clone the repo to a temp directory for local analysis:
git clone --depth 1 <repo-url> /tmp/os-model-research-<model-name>
Read the following files (search for them if paths vary):
Dependency files (in priority order):
requirements.txtsetup.py or setup.cfgpyproject.tomlIf none exist at the root, check subdirectories (some repos put these in src/ or the main package dir).
Build-time torch dependencies - scan requirements.txt for packages known to require torch at build time:
auto_gptq - CUDA quantization, needs torch for buildingflash-attn / flash_attn - Flash Attention, needs torch for buildingbitsandbytes - quantization library, needs torch@ git+https://... that builds CUDA extensionsIf any of these are present, note them in the spec's "Build-time torch dependencies" field. This determines whether torch must be pre-installed via pip_dependencies before requirements.txt is processed.
HuggingFace model validation - for every HF model ID you find (strings matching org/model-name or hf.co/ URLs), verify it is a real, publicly accessible HF repo:
curl -sI "https://huggingface.co/<org>/<repo>" | head -1
A real repo returns HTTP/2 200. A 404 means the repo doesn't exist or is private. Only include real, verified repo IDs in the ## HuggingFace Models section. If a model is bundled inside a parent repo (e.g., a component of org/MainModel rather than its own repo), list the parent repo ID and note which component it provides.
Source code analysis - look for inference API entry points:
predict, generate, infer, forward, __call__, run, processfrom_pretrained calls to identify model loading patternsorg/model-name pattern, or huggingface.co/, hf.co/ URLs)demo.py, inference.py, example.py, or files in examples/ or demo/ directories__init__.py at the top level to understand exported symbolsLicense - read LICENSE or LICENSE.md.
Pip-installability check - determine if the repo can be installed via pip:
setup.py or pyproject.toml exists with a [build-system] section or from setuptools import setuprequirements.txt exists (deps only, no package definition)Based on the README examples and source code, identify which nodes to create. Guidelines:
SuccessFailureNodeFor each node, determine:
From the model name and repo:
"Griptape Nodes SAM3 Library"griptape_nodes_library_<dependency_name>, e.g. griptape_nodes_library_sam3 (NOT griptape_nodes_sam3_library -- the prefix is griptape_nodes_library_, not a _library suffix). The repo dir on disk follows the same pattern: griptape-nodes-library-<dependency_name>, e.g. griptape-nodes-library-sam3.sam3["Griptape", "AI", "Image", "Segmentation"])Category color reference (from existing libraries):
border-blue-500 - audio/segmentationborder-red-500 - control/generationborder-purple-500 - data/processingborder-green-500 - image/videoWrite the complete spec to <library-repo-path>/.scratch/os-model-spec-<model-name>/spec.md.
Every field must be filled in with real data. Do not leave any placeholders.
# <Model Name> Library Specification
## Model Info
- **Name**: <human-readable model name>
- **Repo URL**: <full GitHub URL>
- **License**: <license type, e.g., Apache 2.0, MIT, CC-BY-NC>
- **Description**: <one paragraph describing what the model does>
- **Primary Domain**: <image segmentation | depth estimation | audio generation | video generation | etc.>
## Repository Structure
- **Main Package Name**: <Python import name, e.g., sam3>
- **Entry Points**: <list the main inference classes/functions with their signatures>
- **Model Loading**: <how models are loaded, e.g., `Model.from_pretrained("org/model-id")`>
- **Has setup.py/pyproject.toml**: <yes | no>
- **Pip-installable**: <yes | no>
## Dependencies
- **Has requirements.txt**: <yes | no> (if yes, library_advanced.py installs it directly at runtime - do not copy contents here)
- **Torch required**: <yes/no> (if yes, torch must be in pip_dependencies so it's installed before requirements.txt)
- **GPU Requirements**: <CUDA required | CUDA + MPS supported | CPU only>
- **Build-time torch dependencies**: <list any packages in requirements.txt that need torch at build time, e.g., auto_gptq, flash-attn, or "none">
- **Special install notes**: <anything unusual not covered by requirements.txt, e.g., manual build steps>
## HuggingFace Models
- `<org/model-id>`: <description, approximate size>
- `<org/model-id-2>`: <description, approximate size>
## Library Configuration
- **Library Name**: <e.g., "Griptape Nodes SAM3 Library">
- **Package Dir Name**: <e.g., griptape_nodes_library_sam3>
- **Submodule Name**: <e.g., sam3>
- **Tags**: [<tag1>, <tag2>, ...]
- **Categories**:
- name: <category-key>, color: <border-color-500>, title: <Title>, description: <desc>, icon: <icon-name>
## Nodes to Implement
### <NodeClassName>
- **Class Name**: <PascalCase>
- **File Name**: <snake_case>.py
- **Base Class**: SuccessFailureNode
- **Category**: <category-key from above>
- **Description**: <what this node does>
- **Display Name**: <Human Readable Name>
**Inputs**:
| Name | Type | Default | Required | Tooltip |
|------|------|---------|----------|---------|
| <name> | <str/int/float/ImageUrlArtifact/AudioUrlArtifact/VideoUrlArtifact> | <default> | <yes/no> | <tooltip> |
Note: Use URL artifact variants for all media inputs (`ImageUrlArtifact`, `AudioUrlArtifact`, `VideoUrlArtifact`). `VideoArtifact` does not exist. For inputs that select a HuggingFace model (values are repo IDs from `## HuggingFace Models`), use type `HuggingFaceModel` in the table. Do NOT list them as plain `str` with Options choices -- the node implementation phase will use `HuggingFaceRepoParameter` (or another `HuggingFaceModelParameter` subclass) for these.
**Outputs**:
| Name | Type | Description |
|------|------|-------------|
| <name> | <type> | <description> |
**Processing Logic**:
<Describe step-by-step what process() should do:
1. Read inputs from self.parameter_values
2. Import model code (deferred): from <package> import <Class>
3. Load model (use class-level caching): Model.from_pretrained(model_id)
4. Run inference: result = model.predict(...)
5. Convert output to artifact and set self.parameter_output_values>
### <NodeClassName2> (if applicable)
...
## Advanced Library Notes
- **Submodule branch**: <main | master | specific tag>
- **Post-install patches needed**: <describe any monkey-patches required, or "none">
- **Install method**: <pip install --no-deps | sys.path.insert>
- **Notes**: <any quirks discovered during research>
Remove the temp clone:
rm -rf /tmp/os-model-research-<model-name>
Verify the spec file:
... placeholder text remainsReport the spec file path back to the caller.