Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Create a fine-tuned OpenAI model with R2

A step-by-step tutorial for building a Cloudflare Worker that retrieves fine-tuning datasets from R2 storage and transmits them to the OpenAI API to create custom models.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Create a fine-tuned OpenAI model with R2

A step-by-step tutorial for building a Cloudflare Worker that retrieves fine-tuning datasets from R2 storage and transmits them to the OpenAI API to create custom models.

When To Use

Use when you need to implement a workflow that automates the process of feeding stored datasets from Cloudflare R2 into OpenAI's fine-tuning API using a Worker.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-workflow-guide.mdA tutorial guide explaining how to use Cloudflare Workers and R2 storage to facilitate the fine-tuning of OpenAI models.Questions about a tutorial guide explaining how to use Cloudflare Workers and R2 storage to facilitate the fine-tuning of OpenAI models.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op.textThe npm command used to initialize the Cloudflare Workers project for fine-tuning OpenAI models using R2 storage.Exact payloads, commands, or snippets shown in The npm command used to initialize the Cloudflare Workers project for fine-tuning OpenAI models using R2 storage.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-2.textThe yarn command used to initialize the Cloudflare Workers project for fine-tuning OpenAI models with R2 storage.Exact payloads, commands, or snippets shown in The yarn command used to initialize the Cloudflare Workers project for fine-tuning OpenAI models with R2 storage.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-3.textThe pnpm command used to initialize the Cloudflare Workers project for fine-tuning OpenAI models with R2 storage.Exact payloads, commands, or snippets shown in The pnpm command used to initialize the Cloudflare Workers project for fine-tuning OpenAI models with R2 storage.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-4.textTerminal commands and directory structure setup for initializing the fine-tuning project using Cloudflare Workers and R2.Exact payloads, commands, or snippets shown in Terminal commands and directory structure setup for initializing the fine-tuning project using Cloudflare Workers and...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-5.textA shell command used to create a new R2 bucket via the Wrangler CLI.Exact payloads, commands, or snippets shown in A shell command used to create a new R2 bucket via the Wrangler CLI.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-6.textA wrangler cli command used to upload a fine-tuned model file to a Cloudflare R2 bucket.Exact payloads, commands, or snippets shown in A wrangler cli command used to upload a fine-tuned model file to a Cloudflare R2 bucket.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-7.textA configuration object defining R2 bucket bindings and parameters for indexing fine-tuned OpenAI models within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A configuration object defining R2 bucket bindings and parameters for indexing fine-tuned OpenAI models within a Clou...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-8.textA configuration snippet defining the R2 bucket binding required to store and index fine-tuned OpenAI model data within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A configuration snippet defining the R2 bucket binding required to store and index fine-tuned OpenAI model data withi...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-9.textA text file containing the npm installation command and initial setup steps for a Cloudflare Workers project using Hono to manage OpenAI fine-tuning with R2.Exact payloads, commands, or snippets shown in A text file containing the npm installation command and initial setup steps for a Cloudflare Workers project using Ho...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-10.textA text file containing the initial project setup commands and dependencies for a Cloudflare Workers project using Hono to index fine-tuned OpenAI models with R2.Exact payloads, commands, or snippets shown in A text file containing the initial project setup commands and dependencies for a Cloudflare Workers project using Hon...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-11.textA configuration guide and dependency installation steps for setting up a Cloudflare Worker using Hono to manage OpenAI fine-tuning with R2 storage.Exact payloads, commands, or snippets shown in A configuration guide and dependency installation steps for setting up a Cloudflare Worker using Hono to manage OpenA...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-12.textA configuration command and setup guide for initializing a Hono application to manage OpenAI fine-tuning data using Cloudflare R2.Exact payloads, commands, or snippets shown in A configuration command and setup guide for initializing a Hono application to manage OpenAI fine-tuning data using C...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-13.textA text-based guide and command sequence for installing the OpenAI library to facilitate fine-tuning models using Cloudflare R2 storage.Exact payloads, commands, or snippets shown in A text-based guide and command sequence for installing the OpenAI library to facilitate fine-tuning models using Clou...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-14.textA text file containing the installation command and initial setup steps for integrating OpenAI with Cloudflare Workers and R2 storage.Exact payloads, commands, or snippets shown in A text file containing the installation command and initial setup steps for integrating OpenAI with Cloudflare Worker...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-15.textA list of terminal commands and dependencies required to set up a Cloudflare Worker for fine-tuning OpenAI models using R2 storage.Exact payloads, commands, or snippets shown in A list of terminal commands and dependencies required to set up a Cloudflare Worker for fine-tuning OpenAI models usi...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-16.textA guide and command sequence for setting up OpenAI fine-tuning using Cloudflare Workers and R2 storage.Exact payloads, commands, or snippets shown in A guide and command sequence for setting up OpenAI fine-tuning using Cloudflare Workers and R2 storage.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-17.textA Hono-based Cloudflare Worker implementation that integrates OpenAI API with R2 storage for fine-tuning models.Exact payloads, commands, or snippets shown in A Hono-based Cloudflare Worker implementation that integrates OpenAI API with R2 storage for fine-tuning models.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-18.textA TypeScript code snippet demonstrating how to retrieve a file from Cloudflare R2 and upload it to OpenAI for model fine-tuning using a Cloudflare Worker.Exact payloads, commands, or snippets shown in A TypeScript code snippet demonstrating how to retrieve a file from Cloudflare R2 and upload it to OpenAI for model f...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-19.textA TypeScript code snippet demonstrating how to use Cloudflare Workers to trigger an OpenAI fine-tuning job using a file stored in R2.Exact payloads, commands, or snippets shown in A TypeScript code snippet demonstrating how to use Cloudflare Workers to trigger an OpenAI fine-tuning job using a fi...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-20.textA TypeScript implementation demonstrating how to use Cloudflare Workers to manage OpenAI fine-tuning jobs using R2 for data storage.Exact payloads, commands, or snippets shown in A TypeScript implementation demonstrating how to use Cloudflare Workers to manage OpenAI fine-tuning jobs using R2 fo...
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-21.textWrangler CLI commands for configuring OpenAI API keys as secrets in a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in Wrangler CLI commands for configuring OpenAI API keys as secrets in a Cloudflare Workers environment.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-22.textThe wrangler deploy command used to deploy the Cloudflare Worker project for fine-tuning OpenAI models with R2 storage.Exact payloads, commands, or snippets shown in The wrangler deploy command used to deploy the Cloudflare Worker project for fine-tuning OpenAI models with R2 storage.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-23.textA JSONL formatted dataset used for fine-tuning OpenAI models stored in Cloudflare R2 via Workers.Exact payloads, commands, or snippets shown in A JSONL formatted dataset used for fine-tuning OpenAI models stored in Cloudflare R2 via Workers.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-24.textA curl command used to query a Cloudflare Worker for fine-tuned OpenAI model information using an R2 file ID.Exact payloads, commands, or snippets shown in A curl command used to query a Cloudflare Worker for fine-tuned OpenAI model information using an R2 file ID.
examples/workers-create-finetuned-chatgpt-ai-models-with-r2-index-a-fine-tuned-op-25.textA JavaScript implementation demonstrating how to use Cloudflare Workers and R2 to interact with a fine-tuned OpenAI model.Exact payloads, commands, or snippets shown in A JavaScript implementation demonstrating how to use Cloudflare Workers and R2 to interact with a fine-tuned OpenAI m...

What This Skill Covers

  • In this tutorial, you will use the OpenAI ↗ API and Cloudflare R2 to create a fine-tuned model ↗.
  • Main sections: Tags, Prerequisites, 1\. Create a Worker application, 2\. Upload a fine-tune document to R2, 3\. Bind your bucket to the Worker.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/tutorials/create-finetuned-chatgpt-ai-models-with-r2/index.md