Running LLaMA and Alpaca Locally: A 2023 Dalai Tutorial

Matthew Berman demonstrates an early local-model setup on a MacBook Air and explains the settings that control generation.

MBMatthew BermanVortrag · Forward Future
Kanal
Matthew Berman
Veröffentlicht
19. März 2023
Video
6:50
Lesezeit
3 Min.
Folien
3
Original
Englisch
Auf YouTube öffnen
Beim Scrollen schrumpft das Video in die rechte untere Ecke und läuft weiter. Untertitel folgen Ihrer Lesesprache.
LesespracheIn 2 Sprachen verfügbar
Diesen Artikel gibt es noch nicht auf Deutsch, daher wird das Original (Englisch) angezeigt.
ZUSAMMENFASSUNG

In 30 Sekunden

In this 2023 tutorial, Matthew Berman demonstrates the Dalai tool for running early LLaMA and Stanford Alpaca models locally. He covers installation, starting a local server and changing generation settings. The commands and model availability are historical and may no longer work as shown. Stanford's reported sub-$600 cost covered generating instruction data and fine-tuning an existing LLaMA 7B model, not pretraining it from scratch. Its preliminary comparison with text-davinci-003 was limited in scope and did not establish parity with ChatGPT or GPT-4.

  1. 1A small instruction-tuned modelBerman introduces Stanford Alpaca as a derivative of Meta's LLaMA 7B. Stanford's reported cost covers data generation and fine-tuning, not the original pretraining.
  2. 2Historical local setupHe installs Dalai and model files, then starts a local server. Tools, downloads and license terms may differ today.
  3. 3Output lengthA response stops at the n_predict limit, so Berman raises it to allow a longer answer.
  4. 4Cost comparison needs contextBerman compares Alpaca's reported cost with GPT-3 training. The numbers cover different stages and do not establish equal capability or equivalent total training cost.

Das Wichtigste

  1. Alpaca 7B was fine-tuned from LLaMA 7B using 52,000 instruction examples generated with text-davinci-003.
  2. The reported sub-$600 reproduction cost excluded the cost of pretraining LLaMA and should not be compared as a like-for-like full training cost.
  3. The video demonstrates a historical Dalai setup with Node.js, model downloads and a local server on a MacBook Air.
  4. The n_predict setting limits output tokens; increasing it can prevent a response from stopping at that limit.
  5. The original LLaMA and Alpaca releases carried non-commercial research restrictions and the setup is a historical example.
VOLLTEXT

Den bearbeiteten Text nach Kapiteln lesen

Nur das Transkript
01

Alpaca and its training recipe

Berman introduces Stanford's instruction-tuned model and its relation to LLaMA. The reported cost and model comparison require the scope of Stanford's preliminary experiment.

Stanford's Alpaca is an instruction-tuned model based on Meta's LLaMA 7B. In this 2023 demonstration, I run LLaMA and Alpaca locally on a MacBook Air using a tool called Dalai. The original models had research and non-commercial restrictions, and today's installation experience may be different.

Stanford reported that Alpaca behaved qualitatively similarly to text-davinci-003 in a preliminary single-turn instruction evaluation. Berman is impressed by the model's size and cost, while saying his own tests did not put it on par with GPT-4. That limited comparison does not establish broad equivalence to ChatGPT or GPT-4.

The often-cited cost below $600 is not the price of training the whole model from scratch. Stanford reported spending less than $500 on API-generated examples and under $100 on the initial fine-tuning run, using an already pretrained LLaMA 7B model. Its base-model pretraining cost is not included.

Stanford started with 175 human-written instruction-output pairs from the Self-Instruct seed set and used text-davinci-003 to generate roughly 52,000 examples. Those examples were used to fine-tune LLaMA 7B. Berman points viewers to the Stanford announcement and notes that its public demo was no longer available when he recorded the video.

02

Installing and running Dalai

He demonstrates a historical Node.js and Dalai installation, model downloads and a local server. The software and availability may have changed.

The tutorial uses the Dalai repository by cocktailpeanut. Berman says Node.js 18 or later is needed and demonstrates installing the package, then downloading LLaMA 7B and 13B and Alpaca 7B. He already has the models and cancels repeated downloads; one need not install both LLaMA sizes to follow the example.

Dalai commands in the historical tutorial
FOLIE 1 / 3Dalai commands in the historical tutorialThe video shows the Alpaca installation and local server commands used in 2023.

Once the model files are in place, Berman starts the local server with `npx dalai serve` and opens its local interface. He selects a model and asks how llamas and alpacas are related. These are the commands and interfaces shown in the 2023 video, not a guarantee of a currently supported setup.

03

Generation settings and cost claims

Berman adjusts the output length, describes other settings and discusses the falling cost of models. His cost comparison omits the base model's pretraining.

Output token limit
FOLIE 2 / 3Output token limitThe n_predict field limits the generated response length in the demonstrated interface.

The answer stops when it reaches the `n_predict` limit of 200 tokens. Increasing the setting allows a longer response. The interface also offers a model selector, an optional remote server URL, a thread count, a seed and a temperature setting that affects variation in the output.

Dalai generation options
FOLIE 3 / 3Dalai generation optionsThe repository documentation describes model selection, threads and generation settings.

Berman cites a prediction that AI training costs would fall rapidly and compares the cost of GPT-3 with Alpaca's reported cost. Those figures are not directly comparable: Alpaca's number covers data generation and fine-tuning on an existing pretrained model, and the preliminary evaluation does not prove equivalent performance. He closes excited about trying more models locally and comparing their strengths.

Mehr aus diesem Kanal

12 Folien34:21EN
Matthew Berman· 27. Okt. 2026Matthew Berman Examines Anthropic’s IPO Filing, AI Growth and GovernanceMatthew Berman, Sam Altman · Forward FutureThe presenter reviews the S-1’s financial metrics, compute strategy and voting structure while questioning the tension between rapid AI development and safety.AnthropicAI SafetyEnterprise-KI+2
2 Folien0:36EN
Matthew Berman· 25. Okt. 2026Kimi K3.1 and a Rubik’s Cube Solver DemonstrationMatthew Berman · Forward FutureMatthew Berman shows a scrambled virtual cube being solved and gives the Kimi K3.1 test a favorable assessment.EvalsCoding-AgentenOpen-weight models
6 Folien25:50EN
Matthew Berman· 24. Okt. 2026Kimi K3.1 Pro Tested: Strong 3D Demos, Uneven Results and Competitive PricingMatthew Berman · Forward FutureMatthew Berman tests the open-weight model on coding, 3D rendering and visual explanations, then compares benchmark results and prices.Open-weight modelsBenchmarksAI cost & performance+1
2 Folien32:20EN
Matthew Berman· 23. Okt. 2026Who Is Local AI For? The Costs, Trade-offs and a Hybrid FutureMatthew Berman · Forward FutureMatthew Berman weighs data control and independence against hardware cost, setup complexity and inference speed.Local inferenceOpen-weight modelsAI cost & performance+1
6 Folien1:03:37EN
Matthew Berman· 23. Okt. 2026Matthew Berman’s Team Tests Kimi K3.1 on Animation, Games, and ChartsMatthew Berman, Alex, Brian · Forward FutureA live team AMA turns into an informal test of Kimi K3.1, from personal-agent workflows to motion graphics, a browser game, and a benchmark chart.Coding-AgentenGenerative mediaEvals+2
0:53EN
Matthew Berman· 22. Okt. 2026Sam Altman on AI and the Discovery of New KnowledgeSam Altman · OpenAIAltman expects progress in mathematical discovery to extend to biology, materials and energy.AI for scienceMathematicsComputational Biology+1