openai/openai-cookbook
View on GitHub ↗ ★ 76,913 Jupyter Notebook
Examples and guides for using the OpenAI API
77 mentions on Hacker News by 63 people: 25 stories, 52 comments · first 2022-08-22 · latest 2026-09-10
20082026
-
…my comment because the links are now fixed! And they point to a public repo under the openai org: https://github.com/openai/openai-cookbook/tree/main/examples...
comment by varenc · 2026-09-10 · in OpenAI Agents API -
…2023 https://github.com/anthropics/claude-cookbooks/commit/2b3f4a... OpenAI's started in June 2022 https://github.com/openai/openai-cookbook/commit/535f545be7e...
comment by simonw · 2026-07-24 · in Claude Cookbook -
…a much better version using this command instead, which uses the maximum image size according to https://github.com/openai/openai-cookbook/blob/main/examples... OPENAI_API_KEY="$(llm keys get openai)" \ uv run…
comment by simonw · 2026-04-21 · in ChatGPT Images 2.0 -
…why this matters—not just technically, but civilizationally. Would welcome thoughtful engagement: https://github.com/openai/openai-cookbook/issues/2426
comment by vreticaltension · 2026-02-10 · in An Open Letter on the Epistemic Loss of Retiring GPT‑4o -
…I'm interested in both full model finetunes, and downstream matrix optimization as done in [1]. [1] https://github.com/openai/openai-cookbook/blob/main/examples...
comment by curl-up · 2025-08-01 · in Gemini Embedding: Powering RAG and context engineering -
Open AI cookbook https://github.com/openai/openai-cookbook
comment by 3abiton · 2025-05-27 -
…this model to turn out as well as it did? [1] https://x.com/sama/status/1889755723078443244 [2] https://github.com/openai/openai-cookbook/blob/6a47d53c967a0...
comment by comex · 2025-04-14 · in GPT-4.1 in the API -
…is just as active as it ever was w/notebooks. To an almost absurd degree. 5-10 commits a week. https://github.com/openai/openai-cookbook/activity
comment by refulgentis · 2024-12-21 · in Building Effective "Agents" -
…one good option is to use Wikipedia pages from the recent Olympics, which GPT has no knowledge of: https://github.com/openai/openai-cookbook/blob/457f4310700f9...
comment by tedsanders · 2024-09-07 · in Minifying HTML for GPT-4o: Remove all the HTML tags -
The official openai-cookbook ( https://github.com/openai/openai-cookbook ) used to have an explicit, but buried, call out that instruction-following models like `text-davinci-003` were "Less diverse; less creative; sometimes harder to…
comment by hughrlomas · 2024-06-17 · in Creativity has left the chat: The price of debiasing language models -
…learned a couple tricks from OpenAI's Cookbook examples. This one came in handy not too long ago: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by jihadjihad · 2024-04-19 · in Ask HN: High quality Python scripts or small libraries to learn from -
OpenAI cookbook: https://github.com/openai/openai-cookbook Btw, the Claude API might be available even if the chatbot is not.
comment by turing_complete · 2024-04-17 · in Collection of notebooks showcasing some fun and effective ways of using Claude -
OpenAI community repo with lots of examples: https://github.com/openai/openai-cookbook
comment by xnyan · 2023-11-08 · in Major outages across ChatGPT and API -
They have an example python script for batch jobs with retries. https://github.com/openai/openai-cookbook/blob/main/examples...
comment by dsalzman · 2023-08-15 · in Ask HN: Batch Processing with OpenAI -
…as far as I know. Even the OpenAI tutorial on this matter scrapes first and uses only normal text. https://github.com/openai/openai-cookbook/blob/main/apps/web...
comment by jack_pp · 2023-08-02 · in I'm betting on HTML -
…with labelled similar and dissimilar video pairs, like in this notebook[1] from OpenAI. [1]: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by woadwarrior01 · 2023-08-01 · in USearch: Smaller and faster single-file vector search engine -
They've released an "OpenAI Cookbook" with examples of several common tasks. https://github.com/openai/openai-cookbook
comment by MilnerRoute · 2023-07-09 · in Ask HN: Where to learn what you can do with ChatGPT? -
…provides the background for the tradeoff between the 2 approaches: 1) fine-tuning vs 2) Search-ask https://github.com/openai/openai-cookbook/blob/main/examples...
comment by emmender · 2023-07-09 · in PdfGptIndexer: Indexing and searching PDF text data using GPT-2 and FAISS -
…of mind for us and something we are continuing to push on. Does streaming work for your use case? https://github.com/openai/openai-cookbook/blob/main/examples... We definitely want to investigate these and the billing issues further. Would…
comment by athyuttamre · 2023-07-06 · in GPT-4 API General Availability -
Yes, you can essentially use GPT functions to reliably output JSON based on a predefined schema. See https://github.com/openai/openai-cookbook/blob/main/examples...
comment by hubraumhugo · 2023-07-03 · in Show HN: JobLens – AI-powered job search for 'Who Is Hiring' -
…vector representation of any text very easily using the openai apis, or frameworks like langchain https://github.com/openai/openai-cookbook/blob/main/examples... Similarity means your text gets turned into an array of numbers and the…
comment by JimmyRuska · 2023-07-02 · in Vector support in PostgreSQL services to power AI-enabled applications -
…significantly (for example, on word math problems, solve rate went from 18% to 79%). Source: https://github.com/openai/openai-cookbook/blob/main/techniqu...
comment by hmage · 2023-07-01 · in Workers with less experience gain the most from generative AI -
…Like I said, it still all feels like we're in wild west times, at least as an app developer. [1] https://github.com/openai/openai-cookbook
comment by daviding · 2023-06-29 · in Building Boba AI: Lessons learnt in building an LLM-powered application -
…could be parsing errors. OpenAI's demo for function calling is not a Hello World, to put it mildly: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by minimaxir · 2023-06-14 · in Native JSON Output from GPT-4 -
…://platform.openai.com/docs/guides/gpt/function-calling they also have a notebook with more examples: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by naiv · 2023-06-13 · in Function calling and other API updates -
…of "prompt engineering" is more about building new software on top of LLMs - the kind of stuff in https://github.com/openai/openai-cookbook I see using ChatGPT directly as prompting, not prompt engineering.
comment by simonw · 2023-04-28 · in You probably don't know how to do Prompt Engineering -
…about fine-tuning because they want to solve this problem. The best answer I've seen so far is in https://github.com/openai/openai-cookbook/blob/main/examples... > Although fine-tuning can feel like the more natural option—training on data…
comment by simonw · 2023-04-22 · in Finetuning Large Language Models -
The OpenAI Cookbook has had an easy to use chat with a PDF app example for a few months. https://github.com/openai/openai-cookbook/tree/main/apps/fil...
comment by robflaherty · 2023-04-19 · in ChatPDF – Chat with Any PDF -
…Where did title came from? Another point is that OpenAI changed encoders for chat models. Link: https://github.com/openai/openai-cookbook/blob/main/examples... Now English is less optimized for tokens usage and other languages are much…
comment by rubywilde · 2023-04-12 · in Why is GPT-3 15.77x more expensive for certain languages? -
I wasn't aware that GPT-3 and GPT-4 use different tokenizers. I've read https://github.com/openai/openai-cookbook/blob/main/examples... and misinterpreted "ChatGPT models like gpt-3.5-turbo and gpt-4 use tokens in the same way as older…
comment by lowefk · 2023-04-06 · in OpenAI Tokenizer -
Different GPTs use different tokens: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by tedsanders · 2023-04-05 · in OpenAI Tokenizer -
This guide explains how to count tokens for 3.5-turbo and beyond: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by tedsanders · 2023-04-05 · in OpenAI Tokenizer -
Here's a way to do it in your own code: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by Cyphase · 2023-03-29 · in Show HN: GPT Calculator – Calculate the token count and cost of your GPT Prompt -
…- https://github.com/neuml/txtai/blob/master/examples/03_Build... - https://github.com/openai/openai-cookbook/blob/main/examples...
comment by thund · 2023-03-25 · in Open-Source GPT-4 Platform for Markdown -
https://github.com/openai/openai-cookbook/blob/main/examples... https://github.com/pinecone-io/examples/blob/master/generati... https://www.pinecone.io/learn/openai-gen-qa/ https://www.youtube.com/watch?v=tBJ-CTKG2dM&t=787s&ab_channe...…
comment by gk1 · 2023-03-23 · in Cheating is All You Need -
…or similar techniques, essentially asking the model to explain how it arrived at a solution. https://github.com/openai/openai-cookbook/blob/main/techniqu...
comment by antondd · 2023-03-15 · in Show HN: AI explanations for other people’s code -
Yes. You can use fine tuning ( https://platform.openai.com/docs/guides/fine-tuning and https://github.com/openai/openai-cookbook/tree/main/examples... ) to improve its knowledge set of a particular domain. Even with sufficient work on your…
comment by shagie · 2023-03-15 · in We can't all use AI. Someone has to generate the training data -
Probably the embeddings API. This guide is what helped me understand the concept https://github.com/openai/openai-cookbook/blob/main/examples... tl;dr is that you can pre-process each chunk of your database and use embeddings to quickly…
comment by Hyzer · 2023-03-02 · in Introducing ChatGPT and Whisper APIs -
…you query the vectorized embeddings and then pass the n relevant texts into the completion api. https://github.com/openai/openai-cookbook/blob/main/examples...
comment by infecto · 2023-02-24 · in Show HN: Get advice from a GPT3-based stoic philosopher -
I think https://github.com/openai/openai-cookbook/blob/main/examples... is the one they are referring to. This is the page that links it https://github.com/openai/openai-cookbook/blob/main/text_com...
comment by cheeseblubber · 2023-02-23 · in Custom Embeddings: Why going viral caused us to rip out everything in a weekend -
…and downgrading to curie in several steps as you polish prompts and breakdown tasks (see https://github.com/openai/openai-cookbook/blob/main/techniqu... ). I haven't gotten beyond the davinci for prototyping tho. It's cheap enough that a…
comment by jrvarela56 · 2023-02-08 · in Use GPT-3 incorrectly: reduce costs 40x and increase speed by 5x -
…stored in it. For example a notebook for "lets train GPT on the information about the olympics - https://github.com/openai/openai-cookbook/blob/main/examples... and https://github.com/openai/openai-cookbook/blob/main/examples... and…
comment by shagie · 2023-02-01 · in Show HN: DocAsker – Use LLMs to ask documentation questions -
…https://pair.withgoogle.com/guidebook/ LLM advice: Tips to improve prompt and answer quality. https://github.com/openai/openai-cookbook/blob/main/techniqu... I wrote a short overview of some of the LLM Application development tools and…
comment by jmcminis · 2023-01-23 · in Ask HN: Best resources to learn how to use OpenAI for your startup? -
Mr Kumar seems to have missed the guide. Here https://github.com/openai/openai-cookbook/blob/main/techniqu...
comment by throwaway29303 · 2023-01-23 · in ChatGPT Is Bad at Math -
…as truthfully as possible, and if you're unsure of the answer, say "Sorry, I don't know" [0] https://github.com/openai/openai-cookbook/blob/main/examples... (which is now linked in OP)
comment by rahimnathwani · 2023-01-22 · in How to implement Q&A against your docs with GPT3 embeddings and Datasette -
…that it can already solve more difficult problems when given the right prompts and constraints. https://github.com/openai/openai-cookbook/blob/main/techniqu...
comment by programmarchy · 2023-01-22 · in What ChatGPT and AI-Based Program Generation Mean for Future of Software -
https://github.com/openai/openai-cookbook/blob/main/examples... would be something to look at too.
comment by shagie · 2023-01-16 · in OpenAI starts testing ChatGPT premium -
…is not the right approach for this use-case. A better approach might look more like this: https://github.com/openai/openai-cookbook/blob/main/examples...
comment by sammyd56 · 2023-01-08 · in GPT3 Get answers to technical questions from your documentation site -
Here’s the example notebook that shows how to do this. https://github.com/openai/openai-cookbook/blob/main/examples...
comment by iamflimflam1 · 2023-01-08 · in GPT3 Get answers to technical questions from your documentation site