Setting Up Your Platform Prereqs - Build AI Platforms From Scratch #2
Source: Dev.to
šŗ View this module with video & slides
Quick Reminder
- This course isnāt about writing code. A code repository in the External Resources section contains common patterns for calling thirdāparty LLM APIs, parsing responses, counting tokens, and assessing cost.
- For a more focused learning environment, take the course on nicholasmgoldstein.com/courses.
- The course is free; you can support the creator by liking, subscribing, or checking out AI platforms like Emstrata (emstrata.com).
- Feedback is welcomeācomment with topics youād like covered more thoroughly or any unclear points.
Picking an LLM
Choosing early prevents later paralysis.
- LLM Strengths and Learning: Different models have distinct strengths and textual voices. The best way to learn them is by iterating on system prompts rather than relying solely on benchmarks.
- Recommended LLMs: Personal favorite is Claude/Anthropic (versions 3.7ā4.0). ChatGPT/OpenAI and Gemini/Google are also solid options. All typically require a credit card; see each providerās pricing page for details.
- MultiāLLM Strategy: Use multiple models for different tasks. For example, ClaudeāÆ4.0 excels at heavy analysis and ruleāfollowing, while smaller models like Mistral handle simpler tasks, saving money while staying effective.
- Additional Tools: OpenAI and Google often bundle builtāin tools such as textātoāspeech, transcription, and image generation, which Anthropic may lack.
The Choice is Yours
API workbench links
- Anthropic ā
- OpenAI ā
- Google ā
- Mistral ā
Anatomy of an AI Request
How building in the workbench looks:
- Prompt Library System: Most workbenches let you save prompts for testing. Adopt a naming convention for highāvolume usage.
- Model Selection: Click the model name (e.g.,
claude-sonnet-4-5ā¦) to switch between providers. - System Prompt: The static instruction sent to the LLM; defines behavior and context.
- User Request: The data sent for a specific instance (the term āUserā can be misleading outside chatbot contexts).
- Expected Response: The APIās LLM output, which you can test and iterate on before integrating.
Intermediate Techniques
System Prompt Variables & Message Pairs
- System Prompt Variables: Wrap camelCase strings in
{{...}}to create variables inside your system prompt. Useful for customization and modularity. - Message Pairs: Commonly used for chat history, they add context to a request and maintain conversation continuity across interactions.
Note: The author prefers to systematize user requests rather than rely heavily on prompt variables. Both approaches have merit.
Thoughts on Frontend/Backend
- Security Warning: Never expose API keys on the frontend. All thirdāparty LLM calls should be made from the backend to protect your financial accounts. Set proper limits and keep keys secret.
- Tech Stack (example):
- Frontend ā TypeScript + Vite
- Mobile ā Flutter
- Backend ā Go + Gin
- AIāPowered IDEs: Tools like Cursor dramatically boost productivity, especially for nonācoders.
The course wonāt focus on code, but concrete steps for a basic frontend and backend are provided for you to iterate on.
Learn While Building
- AI can help newcomers learn coding patterns, but avoid āvibeācoding.ā Understand what the AI writes and why it works.
- In Cursor, ask the agent to āAdd comments explaining what each line of code does in depth. Iām new to coding.ā Then read those comments to deepen your understanding.
Frontend Setup
# TypeScript/Vite
npm create vite@latest my-project-name -- --template vanilla-ts
cd my-project-name
npm install
npm run dev
For detailed instructions, see
setup-instructions.txtin the code repository.
Backend Setup
# Go/Gin
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
Additional Go setup details are in
setup-instructions.txt.
Database Setup
# PostgreSQL & GORM
# Install PostgreSQL first, then:
createdb mydb
# In your Go project:
go get -u gorm.io/gorm
go get -u gorm.io/driver/postgres
Mobile App Setup
# Flutter
flutter create my_project_name
cd my_project_name
flutter run
Install the Flutter SDK.
The Main Takeaway
The purpose of this setup is to provide a readyātoāuse environmentāfrontend, backend, database, and mobileāso you can focus on building. Even if youāre new to coding, you donāt need to master every line now; AIāpowered IDEs will generate code, while your role is to understand, oversee, troubleshoot, and architect the system.