Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can build a useful first LLM app with a small Python program: accept an input, send it to a model through an API, and show the response. Start with one provider and one request; add document retrieval, an interface, or an agent framework only when the app needs it.

What an LLM app does

At its simplest, an LLM app connects your program to a model. Your Python code collects an input, sends it to a model API, receives a response, and presents that response to a person or another part of your application. The provider’s SDK handles much of the API communication; your code still decides what to ask, how to handle the result, and what to do when a request fails.

Keep these decisions separate as the app grows: which model to use, whether to retrieve outside information, whether to use an agent workflow, and how to build the user interface. They solve different problems, and you do not need to adopt a framework to make a first request.

Build a first Python app with one API request

1. Prepare Python and install the SDK

Use Python 3.10 or later for the OpenAI Python SDK described in its official documentation, which says the library provides access to the OpenAI REST API from Python 3.10+ applications. Install the package in your project environment with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Weekly To Do List Notepad, Undated Planner with 52 Sheets (8.5''x11'')
  • 52 PAGES UNDATED WEEKLY PLANNER - This weekly planner features 52 undated pages, measuring 11 x 8.5 inches (A4) in a horizontal layout. It provides ample space for year-round planning, allowing you to schedule at your own pace without wasting pages or skipping dates.
  • THOUGHTFUL FEATURES FOR PLANNING - Our weekly to do list notepad is designed with a top priority, a low priority, and a follow-up section, allowing you to prioritize and stay organized. It also has to do list part, notes part, which can help you track important daily events and develop daily habits.
  • SPIRAL BOUND WEEKLY PLANNER - The weekly planner is spiral-bound for easy page turning and the option to tear off used pages for new plans. It features a transparent cover that protects your pages from dirt and damage.
  • 100 GSM THICK PAPER - Our desk calendar planner is crafted with premium 100 GSM FSC-certified wood-based paper, paired with sturdy cardboard backing to resist ink bleeding and ensure a smooth writing experience. Durable, eco-conscious, and designed for daily use.
  • VERSATILE USAGE - The weekly to-do list notepad is designed to meet all your planning needs and help you stay organized. It's perfect for work, home and school, including habit tracker, event organization, work schedules, travel plans, and more.
pip install openai

The SDK’s documentation identifies the Responses API as its primary interface for interacting with OpenAI models. Because SDKs and API recommendations change, use the current official documentation for the model and API details when you turn an example into runnable code.

2. Keep the API key out of your code

Read credentials from environment configuration rather than putting a key in a Python file. The SDK reference recommends python-dotenv as one way to keep a key out of source control. Do not commit secrets in source files or notebooks, and do not expose them in screenshots. A local environment file can be convenient during development, but ensure it is excluded from version control.

Rank #2
Weekly To Do List Notepad with 52 Undated Sheets(8.5"×11")- Undated Weekly Planner Notepad for Office Desk Accessories and Supplies - Midnight Lilac
  • Maximize Your Productivity: Our weekly to-do list notepad offers a comprehensive task management system, featuring categorized sections for top priorities, low priorities, and follow-ups, ensuring efficient prioritization and task completion.
  • Flexible Weekly Planning: Enjoy the freedom of an undated weekly planner with 52 weeks of customizable planning pages. No more wasted space or skipped dates – start your planning journey whenever you want, whether it's in 2024, 2025, or beyond.
  • Functional Design: Crafted with premium quality covers, twin-wire binding, and a sturdy chipboard backing, our weekly planner desk pad provides flexibility for seamless page-turning and stability on any surface.
  • Premium Quality Materials: Our work planner is crafted with attention to detail, using premium quality 60-pound smooth white paper and sturdy chipboard backing. Measuring at a convenient size of 8.5 x 11 inches (A4), it offers ample space for writing and planning your tasks. The clean and elegant design adds a touch of sophistication to your workspace.
  • Versatile and Long-Lasting: Suitable for various settings including office, home, school, or personal use, our desk planner is built to last throughout the year, ensuring reliability for all your planning needs.

3. Send one request and inspect the result

Follow the current SDK’s minimal Responses API example to create a client, submit a prompt, and inspect the returned text. This first version should do little more: take one input, make one request, and display the output. Then improve the prompt and add error handling before introducing storage, retrieval, or a framework.

Chat Completions is also documented as a supported, earlier standard. Do not mix examples from different API styles without understanding which one you are using; follow current API guidance for a new project.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Thboxes Weekly To Do List Notepad, 8.5"x11" Desk Planner 52 Sheets, Green
  • 【Well-organized Weekly Desk Planner】Our weekly to do list notepad is designed with top priorities part, low priorities part and follow up part, allowing you to prioritize and stay organized. It also has to do list part, notes part and habit tracker part, which can help you tracking important daily events and develop daily habits. The product is made of FSC-certified paper.
  • 【Spiral Binding Weekly Notepad】The weekly planner is bound in spirals, convenient for turning pages or tearing off used pages to make plans again. The to do list notepad has a transparent cover, which can protect your inner pages from getting dirty or damaged.
  • 【Undated Weekly Planner】The undated weekly planner allows you to plan your life freely without wasting space or skipping dates. You can start your planning journey at any time
  • 【100GSM Paper】The desk planner is made of 100gsm paper, it is not easy to bleed, providing you with a smooth writing experience. The back of the planner is made of cardboard, which allows you to write anywhere and make your plan at any time.
  • 【Wide Applications】The weekly to do list notepad is designed to meet all your planning needs and keep you organized, perfect for home, school, and office. It is ideal for meal planning, party planning, work arrangements, travel plans, and also works as practical college essentials and college school supplies for students to sort class schedules, homework deadlines and daily study tasks.

Choose the right next step for the app

Approach Useful when Trade-off
Direct provider SDK You need a small app or want to understand the request-and-response flow. Fewer abstractions and direct API access; you compose additional application logic yourself.
Framework You need to organize multiple integrations, retrieval steps, or workflows. Convenient building blocks introduce abstractions and framework-specific concepts. The available documentation does not establish a universal performance or answer-quality winner.
Hosted model API You want to call a provider’s model without setting up a local model environment. It depends on an external service. The sources cited here do not establish comparable current costs, privacy terms, or latency against local options; assess those for the provider and deployment you choose.
Local or broader model ecosystem You want to explore models and tools beyond one provider’s API. Model availability and infrastructure needs vary. The Hugging Face documentation lists tools such as Gradio for demos and web apps and smolagents for Python agents; these are options, not prerequisites.

Make a chatbot answer questions from your documents

Plain generation answers from the information available to the model in the request and its learned parameters. If the app needs to answer from a maintained set of documents, retrieval augmented generation (RAG) adds a search step: find relevant passages and send them along as context for the model.

Prepare the knowledge base

Divide the documents into sections that can be retrieved individually, then create an embedding for each section. An embedding represents text in a form that can be compared with other text for relevance. Keep the source material organized so that you can inspect which passages the app selects.

Rank #4
Weekly Planner Pad: To Do List Desk Notepad with Multiple Sections - 8.5x11" 52 Sheets - Undated Tear Off Notebook Calendar - Habit Planning Tracker, Task Goal Checklist Organizer - Agenda Plan Pad
  • Ultimate To Do List with Multiple Sections: A to do list lover’s dream, our notepad offers multiple sections with ample space to write all your important tasks so you can organize and track your tasks better than with a regular list. Sheets have separate spaces for each day, as well as sections for a to do list and top priorities, making it easy to prioritize and stay organized. Say goodbye to feeling overwhelmed and hello to a more organized and productive you!
  • Minimalist Design to Boost Productivity: Experience the perfect balance of minimalist and functional design with our weekly to-do list notepad. Each notepad measures 8.5” x 11” and has 52 sheets, so there is enough space to write down everything you need to do. Made with a minimalist black and white design and premium materials, our notepad is the perfect tool to keep you on track and motivated throughout the day!
  • Premium, non-bleed pages: No more frustrations about pens or markers bleeding through flimsy paper! Our notepad is made with premium non-bleed 100 gsm paper to give you the best writing experience. Unlike with our competitors, these pages won’t bleed onto the next one, even if you write with a permanent marker.
  • Sturdy Backing for Writing Anywhere: Our notepad is made with a thick backing that provides a sturdy surface for writing anytime, so you can take it on the go and never miss an important task again. Whether you're at home, in the office, or on the go, you'll always be able to capture your thoughts and stay on top of your daily routine.
  • Easy to Tear Off Pages: The easy to tear off, undated pages make it simple to share your lists with others or start each day with a fresh page. You'll love the convenience of being able to remove yesterday's tasks and start with a clean slate, allowing you to focus on what really matters.

Retrieve at question time

  1. Embed the user’s question.
  2. Use that embedding to retrieve the most relevant knowledge-base sections.
  3. Include the retrieved sections in the model request as context, along with the question.
  4. Show the response, and inspect both the retrieved passages and the answer while developing the app.

This sequence follows the workflow in OpenAI’s guidance on using the OpenAI API for Q&A or chatbots. A document Q&A app is a useful next project because retrieval has a clear purpose: the model receives selected material rather than an entire large file appended indiscriminately to every prompt. Retrieval can supply relevant context, but it does not guarantee a correct answer. Try representative questions and check whether the passages support the response.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Add frameworks when complexity justifies them

Learn the direct request-and-response flow first. Then consider a framework if composing retrieval, tools, or multi-step behavior is becoming difficult to manage in your own code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Thboxes Weekly Desk Planner, 8.5x11 In To Do List Notepad, 52 Sheets, Pink
  • 【Undated Weekly Planner】The home school planner allows you to plan your life freely without wasting space or skipping dates. You can start your planning journey at any time.
  • 【Well-organized Planning Design】Our desk accessories for women is designed with top priorities part, low priorities part and follow up part, allowing you to prioritize and stay organized. It also has to do list part, notes part, which can help you track important daily events and develop daily habits.
  • 【Spiral Binding Design】The weekly planner is bound in spirals, convenient for turning pages or tearing off used pages to make plans again. The to do list notepad has a transparent cover, which can protect your inner pages from getting dirty or damaged.
  • 【Thick Paper】The office supplies for women is made of 100gsm thick paper, it is not easy to bleed, providing you with a smooth writing experience. The back of the planner is made of cardboard, which can remain stable and allows you to write anywhere and make your plan at any time.
  • 【Wide Applications】The desk accessories for women is designed to meet all your planning needs and keep you organized, perfect for home, school, and office, such as meal planning, party planning, work arrangements, travel plans, etc.

LangChain’s Python tutorials include examples for PDF semantic search, RAG, SQL agents, and voice agents. Its learning materials also describe LangGraph primitives as a way to customize agent workflows more directly. That makes a reasonable progression: a direct API call, higher-level integrations when useful, and more customizable workflow building blocks when the application needs control. None is a required starting point.

For a demo or web interface, Hugging Face’s documentation lists Gradio; for Python agent experiments, it lists smolagents. These tools address different parts of an application, so choose them for a specific need rather than adding them all at once.

Test behavior and handle failures

A successful API response does not establish that an answer is accurate. Test questions a user is likely to ask, including cases where the supplied context does not contain the answer. For a document app, review the retrieved passages as well as the generated response: a poor retrieval result can leave the model without the information it needs.

Before expanding the app, handle request failures and make the user experience clear when a response cannot be produced. Keep the first version observable: you should be able to tell what input was sent, whether the request succeeded, and—if using retrieval—which sections were provided as context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Where to learn next

Official documentation is enough to follow the core path. OpenAI offers learning tracks for building agents and developing AI apps at OpenAI Learn. LangChain’s tutorials and academy resources are available through its Python tutorials. Start with material that matches the next problem you are solving, rather than trying to learn every framework before building anything.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.