DEV Community

Cover image for Setting Up Your Platform Prereqs - Build AI Platforms From Scratch #2
Nick Goldstein
Nick Goldstein

Posted on

Setting Up Your Platform Prereqs - Build AI Platforms From Scratch #2

Setting Up Your Platform Prerequisites

Developing the framework to iterate on your platforms, selecting a tech & productivity stack.

📺 View this module with video & slides


Quick Reminder...

For people who may have forgotten:

  • This course isn't for coding. However, there will be a code repo linked in the External Resources section that has common code patterns that you will likely need for calling third-party LLM APIs, parsing responses, counting tokens and assessing cost, etc.
  • If you want a more focused learning environment, take the course on nicholasmgoldstein.com/courses. This way you won't be tempted to jump to a recommended video or divert your attention.
  • This is a free course, but if you want to support me, you can like/subscribe or check out some of my own AI platforms like Emstrata @ emstrata.com.
  • I'm fully open to your input. If there's topics you'd like covered more thoroughly or anything you're unclear on, feel free to comment.

Picking an LLM

Making your choice early on prevents paralysis later.

LLM Strengths and Learning: Different LLMs have varying strengths and textual voices. The best way to learn them is by working with them and iterating on system prompts, rather than solely relying on benchmarks.

Recommended LLMs and Usage: My personal favorite is Claude/Anthropic's third-party API (specifically versions 3.7 to 4.0), but ChatGPT/OpenAI and Gemini/Google are also great options. These platforms typically require a credit card for usage, and pricing information can be found on their respective websites.

Multi-LLM Strategy: Consider using multiple LLMs for different types of tasks. For instance, Claude 4.0 is excellent for heavier analysis and rule-following, while Mistral or other smaller models work well for simpler tasks. This strategy can save money while maintaining effectiveness.

Additional Tools: A benefit of using OpenAI or Google over Anthropic is that their platforms often include other built-in tools such as Text-to-Speech (TTS), transcription, and image generation.

The Choice is Yours

Below are some links to some of the API Workbenches mentioned:

Anatomy of an AI Request

How building in the Workbench looks:

Prompt Library System: Most workbenches have a feature to save prompts for testing. You'll need a naming system for high volume usage.

Model Selection: Click on the model name (e.g., 'claude-sonnet-4-5...') to switch between different Anthropic models or other providers.

System Prompt: The static instruction sent to the LLM. This fundamentally defines what the prompt does and sets the behavior and context for the AI.

User Request: The term 'User' can be misleading for non-chatbot systems. This refers to the particular data sent for a specific instance or request.

Expected Response: This is an LLM response from the API, which you can test and iterate on before implementing in your application.

Intermediate Techniques

System Prompt Variables & Message Pairs:

System Prompt Variables: Wrap camelCase strings in {{...}} to setup a variable within your system prompt. This could be used to customize the prompt for specific purposes or to further modularize prompts.

Message Pairs: The most common use-case is for chat history, but fundamentally adds context to this specific request. This allows you to maintain conversation context across multiple interactions.

NOTE: My personal preference is to avoid things like system prompt variables and instead systematize user requests. You'll see examples of how I do this in the Prompt Engineering module. This is just what makes more sense to me, but both approaches have their merits.

Thoughts on Frontend/Backend

You will need to select which languages/frameworks you want to use:

Security Warning: Do NOT expose your API keys on the frontend AT ALL. This is a massive security vulnerability. This is why third-party LLM API calls will be made on the backend. Remember, your bank accounts and/or cards are linked to these API keys. Set proper limits and don't expose yourself to bad actors.

I'll be using TypeScript/Vite for frontend, Flutter for mobile, and Go/Gin for backend in this tutorial. AI-Powered IDEs will be a necessity for the non-coders (even if you know how to code, they boost productivity significantly). Cursor is my go-to.

Again, code will not be a prominent factor in this course, but I'll give concrete steps for setting up a basic frontend and backend that you can use to iterate on for your project.

Learn While Building

Don't let AI run rampant in your project:

  • If you're new to coding, a non-coder, or just working with code patterns you're unfamiliar with, AI can help you learn.
  • Vibe-coding is overrated—learn what the AI is writing and why it works. This will help you with troubleshooting later and also let you know what is and isn't possible in your own projects. Don't fall for one-shot app-builder marketing; you should still know the fundamentals.
  • In Cursor, instruct your agent to "Add comments explaining what each line of code is doing in-depth. I'm new to coding and would like to understand what each line is doing." This simple instruction will help you immensely and also help the AI think critically about the code it's writing. Then it's on you; actually read the comments for better understanding of your system.

Frontend Setup

TypeScript/Vite Steps/Commands:

  • If you need to revisit: Click into the code repo and open setup-instructions.txt
  • npm create vite@latest my-project-name -- --template vanilla-ts
  • cd my-project-name
  • npm install
  • npm run dev

Backend Setup

Go/Gin Steps/Commands:

  • More instructions for Go: Click into the code repo and open setup-instructions.txt
  • mkdir my-project-name
  • cd my-project-name
  • go mod init github.com/yourusername/my-project-name
  • go get -u github.com/gin-gonic/gin

Database Setup

PostgreSQL & GORM Steps/Commands:

  • More instructions for Database setup: Click into the code repo and open setup-instructions.txt
  • Install PostgreSQL
  • createdb mydb
  • Then in your Go project:
    • go get -u gorm.io/gorm
    • go get -u gorm.io/driver/postgres

Mobile App Setup

Flutter Steps/Commands:

The Main Takeaway

What's the point of all this setup?

If you're new to coding, you don't need to understand any of this code yet. The goal is to have a working environment—frontend, backend, database, mobile—so when you start building, everything's already there.

AI will be essential for the implementation. Cursor and other AI-powered IDEs can write the code. Your job is understanding what you're building, overseeing, troubleshooting, and architecting, not necessarily memorizing syntax, although you will learn a lot about coding throughout this process.


Continue Learning

Watch Module 2 with video & slides

View full course

External Resources

Repo w/ Common Code Patterns

Common code patterns and examples from the course.

System Prompt Generator

A tool for generating effective system prompts for AI platforms.

Emstrata

A platform for creating immersive narrative experiences using AI to generate emergent storylines.

PLATO5

A social engine designed to turn online connections into real-world friendships, with AI integration to facilitate conversations.

Top comments (0)