loading
loading
Utilities
OpenAI chat responses from a file and a prompt.
overview
openai-file is the LLM step in a pipeline: it sends a file and a prompt to an OpenAI chat model and writes the response for the next node.
Model choice is gpt4, 4-32k, chatgpt, or chatgpt-16k. Larger windows fit bigger files at higher cost. The API key arrives as a file input, not on the command line.
Point it at a scan report, findings list, or crawled text when you need summarize, classify, or rewrite before a human or another tool.
source github.com/simonw/llm
use cases
Feed a findings file with a prompt that asks for a short summary, so a long report becomes a few readable lines for the next reviewer.
Pass a list of results and ask the model to group or rank them, turning unsorted output into a prioritized view inside the workflow.
Choose gpt-4-32k or the 16k turbo variant when the input file is large, or a smaller model when context and cost should stay low.
Prompt the model to reshape raw tool text into prose for a writeup, keeping the rewrite inside the pipeline rather than a manual step.
reference
| Name | Type | Flag | Description |
|---|---|---|---|
| input-file | FILE | · | Input file for the model to read. |
| prompt | STRING | · | Prompt applied to the file input. |
| open-ai-api-key | FILE | · | OpenAI API key, supplied as a file. |
| gpt-4 | BOOLEAN | gpt4 | Use OpenAI Chat gpt-4 (aliases 4, gpt4). |
| gpt-4-32k | BOOLEAN | 4-32k | Use OpenAI Chat gpt-4-32k for larger context. |
| gpt-3-5-turbo | BOOLEAN | chatgpt | Use OpenAI Chat gpt-3.5-turbo (aliases 3.5, chatgpt). |
| gpt-3-5-turbo-16k | BOOLEAN | chatgpt-16k | Use OpenAI Chat gpt-3.5-turbo-16k for a wider context window. |
Showing key inputs. openai-file exposes 7 inputs in total.
example
# openai-file: summarize hosts.txt with gpt-4# openai-file input=hosts.txt prompt="List live hosts" gpt4Live hosts from the scan:api.example.comapp.example.comstaging.example.comdev.example.commail.example.comvpn.example.com# openai-file summary of 6 hostsguidance
Use openai-file when a workflow needs an LLM to read a file and return text. It calls OpenAI and needs a key plus outbound access. For deterministic transforms without a model, prefer a text or report utility.
Renders structured data without a model. Prefer it for deterministic transforms.
Builds reports from fixed templates. openai-file uses an LLM for free-form text.
Flattens JSON for grepping. openai-file is generative summarizing, not mechanical reformatting.
faq
related
Spider a URL and return a wordlist for password crackers.
Wordlist and mined-word subdomain permutation.
CSS selectors over HTML, the jq counterpart for markup.
Extract chosen URL parts from stdin into clean line lists.
Import, export, and upsert workflow data against an Airtable base.
Decode Android APK files into smali sources and resources.
A scan report and an API key feed openai-file, which prompts an OpenAI model over the file and writes the generated summary as output.
Facts on this page come from the live Trickest tool library.