This tutorial walks you through how to build an AI that simulates Mark Cuban’s startup/business investment style with few-shot in-context learning and Monte Carlo-like simulations, using Python, Ollama, and several open source AI models, including Meta's Llama 3.2 and Microsoft's Phi-4. You could alternatively use other open source models such as DeepSeek-R1 or closed models such as OpenAI's ChatGPT models (4o, o1, o1-mini, etc.), Anthropic's Claude models, or Google Gemini 2.0 models.
Instead of fine-tuning the model, we structure the prompt with real Shark Tank pitches and investment decisions, allowing the AI to identify patterns and classify pitches just like Cuban would.
We’ll construct a modular LLM workflow, defining an investor persona (Mark Cuban), incorporating structured outputs with Pydantic and JSON libraries, and running Monte Carlo-like simulation to measure how often the AI chooses to invest in a particular pitch. By comparing results across models like Llama 3.2 and Phi-4, we’ll see which one aligns most closely with Cuban’s real-world choices. (Watch until the end to see the results).
This is just a starting point and is by no means an exhaustive analysis. You can expand this workflow by modeling other investors and other types of investors (e.g. VC's), calibrating the few-shot training examples, and testing additional models, to name a few. This setup provides a foundation for replicating expert decision-making with AI.
Important Note: This video is not financial or investing advice. It is an educational tutorial on how to implement few-shot in-context learning with AI/LLM models in Python. It is also a simulation of Mark Cuban, not actually Mark Cuban, and does not represent his ideas, opinions, thoughts, etc. LLM's are still experimental technology that can make errors.
If you find this helpful :
*Like (👍)*
Comment
*Subscribe*
*Subscribe for FREE to the Deep Charts Newsletter* -- deepcharts.substack.com/
*Full Code*
deepcharts.substack.com/p/i-trained-an-ai-to-inves…
Environment (Python 3.9.21): pip install pydantic==2.10.6 ollama==0.4.7 ipykernel==6.29.5
*Resources*
Ollama: ollama.com/
Pydantic: docs.pydantic.dev/latest/
*Chapters*
0:00 Intro to Few-Shot In-Context Learning with AI models
0:25 Workflow for AI Shark Tank Investment Pitch Prediction
0:55 What Few-Shot learning is and isn't
1:14 Use cases for Few-Shot learning
1:23 AI Stack: Ollama, Llama 3.2, Phi-4, and Pydantic
1:59 Disclaimer!
2:21 How to install Ollama on your computer
2:58 Python Environment Setup for AI Shark Tank Investment Pitch Prediction
3:28 Creating Structured Outputs with Pydantic
4:04 Setting up the Prompt: Investor Persona, Few-Shot Examples, and unseen "test" data
5:55 How to setup an AI Shark Tank Pitch Monte Carlo Simulation
7:59 What are the results? Llama 3.2 vs. Phi-
コメント