Using OpenAI's 01-Preview Model In Cursor & OpenAI Playground
October 4, 2024
Parker walks through using OpenAI's 01-Preview model inside Cursor and the OpenAI Playground, showing a practical workflow to test prompts, prep a repo for LLMs, and implement a calendar-delete feature with smart prompts.
Setup: Enable 01-Preview in Cursor#
- In Cursor, open Settings (top-right) > Models > Add Model.
- Select 01-D mini 01-Preview (the 01-Preview model).
- You’ll hit limits quickly. You have two options:
- Set a new hard limit (this can cost about $0.40 per request). Use sparingly.
- Use an OpenAI API key from platform.openai.com and paste it into Cursor (verify to enable).
Actionable note:
- If you’re prototyping or testing, the API key route avoids per-request throttling/costs the hard-limit path incurs.
Code snippet (conceptual):
# Enable 01-Preview in Cursor
Settings -> Models -> Add Model -> 01-D mini 01-PreviewPrompt optimization in OpenAI Playground#
- In Playground, switch to the Assistant area.
- Bring in your Cursor rules:
- Copy Cursor rules from the Cursor directory (the prompt rules you use for Cursor).
- Paste them into the System Instructions in Playground.
- Click Create to generate a system prompt tailored for the 01-Preview model.
- Reopen the chat in Playground:
- Go to the Beta chat flow, paste the modified system prompt, and add it as the system prompt.
- Prep a target repo with repo pack:
- Use repo pack to optimize the entire repo or selected directories/files for LLMs.
- It outputs a structured text file (file summary, tree, repo files, etc.) at the root.
- If you don’t want to dive into docs, you can invoke it via Command-K in your environment and type repo pack to generate the file.
Code snippet (conceptual):
# In Playground
1) Copy Cursor rules from Cursor directory
2) Paste into System Instructions
3) Click Create -> use the generated system promptRepo prep workflow with repo pack#
- Run repo pack to generate a summarized, LLM-friendly view of the repo (file tree, relevant files, etc.).
- It spits out a nice summary file at the repo root. Drag that file into Playground to guide the model on your codebase.
- Example workflow described:
- Generate repo-summary.txt at root
- Paste its contents into Playground to inform code tasks
- Use Playground to iterate on changes and get back results quickly
Simple outline of the flow (conceptual):
$ repo-pack
# outputs: repo-summary.txt at project rootConcrete task: Delete a calendar event with recurrence handling#
- Objective: Add the ability to delete a single calendar event, handling recurring events gracefully.
- UI/UX reference: Model after Google Calendar’s dialog (show options for single instance vs. all future occurrences).
- Files mentioned: a calendar-related dialog TSX file (SheetDialog.tsx or similar) with:
- Recurrence check
- Options: delete this instance, delete all, delete future events
- Prompts and linting:
- Include linting errors you’ve encountered and enforce strict typing to surface dead code.
- Build the prompt to instruct the assistant to implement the new functionality accordingly.
- Execution flow:
- Copy and paste the prompt suite (including objective and lint cues) into Playground.
- Run the model to generate the implementation snippets, then iterate.
- Playground tip: you can compare results or iterate with the “O” (or related) quick actions to re-run smaller changes quickly.
- Typical turnaround: about 2–5 minutes depending on prompt size and repo scope.
Takeaway workflow:
- Use Cursor rules to shape prompts
- Use Playground for rapid iteration and testing
- Use repo pack to prep your repo for LLM-friendly prompts
- Iterate on a concrete feature (calendar delete), leveraging strict typing and lint feedback to refine
Quick tips and caveats#
- 01-Preview limits can bite; prefer API key for a smoother workflow or use sparingly for testing.
- Copy and adapt Cursor rules rather than rewriting from scratch—consistency pays off.
- The Playground is great for rapid testing, prompt tuning, and validating integration prompts before writing code.
- Strict typing and linting help catch dead code early when you’re feeding code tasks to the model.
Takeaways#
- Add 01-Preview in Cursor, but manage limits intelligently (hard limit vs API key).
- Move cursor prompts into Playground as a system prompt to experiment and refine without losing context.
- Use repo pack to produce a concise repo summary for LLMs, then feed that into Playground to guide prompt-based code changes.
- For real features (like calendar deletion with recurrence logic), build a concrete prompt around UX patterns (Google Calendar style dialogs) and validate with linted, strongly-typed prompts.
Links#
Transcript
I'm Parker re I'm a startup founder and I use AI every single day I use cursor like a crazy person and I want to show you how I use 01 preview to get a lot done so I feel like there's some confusion around this we're using cursor it's very simple but some people find it confusing all you do is you go into your settings top right your models and then add model 01 D mini 01- preview that's it you will quickly hit a limit so when you do hit that limit you have two options one is you go in and you set a new hard limit they charge 40 cents per request which is kind of crazy so use them sparingly unless you just want to totally spam it and the next option would be actually grab an API key from the platform so platform. open.com get an openai key and stick it in there verify it that's how you do it very simple if you want to see how I make better prompts the way that I do that I go into the playground I go into assistant I'll take my cursor rules so over here I have cursor rules I'll grab that I use this from cursor directory so I'll grab one of the cursor directories that's what I use for cursor rules then I'll take the cursor rules and I'll put it in the system instructions once I paste that and hit create it will give me back the one that is modified for the model for open AI so then when I go back into the chat playground I'll go into the Beta um and then and I will paste in assistant paste in this hit add so this will be the basically system prompt right and then I will go into my repo and I will pack up the repo so the way that I do that is I use this thing called repo pack and it optimizes an entire repo or the selected directories and files that I want for llms it optimizes them Mak this nice text file you can see it here um but yeah basically file summary a tree repo structure repo files uh you can put in a bunch of other stuff yeah it's called Rebo pack and if you don't feel like reading the docs you just do command K in here and then type it in and then it'll generate it and it'll spit it out at the root and then now you have this nice file I'll drag that grab it and go into the playground and then at the bottom of the playground after I've done this I will do something like this we are trying to add the ability to delete a single event on a calendar and have it check if the event is recurring or not if the event is recurring then you need to show a Shaden at dialogue. TSX that's customized that has the following fields or the following functionality it needs to check to see if it's recurring and ask the user if they should delete just this one instance of the event or all of the events or any future events model it after the Google Calendar dialog that shows up I give it the objective I also give it any linting errors that I have so turns out I have a few of these I could grab all these right click them hit copy I do really strict typing on here too so I can see where there's dead code I would say review all the review all the errors and linting and implement the new functionality here is the tire and then I would paste that in right so now I have all that stuff then I hit run so that's how I do it it works really well for me if you want to you can compare it and then you can do o on Mini do all these things that's another benefit of the playground is you can do stuff like that and then it'll give it back to you I find it usually takes like 2 to 5 minutes based on how much stuff that's it if you like the video make sure you subscribe I post a lot of stuff like this and you can reach me on Twitter if you have any questions