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 Berman登壇者 · Forward Future
チャンネル
Matthew Berman
公開日
2023年3月19日
動画
6:50
読了時間
3 分
スライド
3
原文
英語
YouTube で開く
スクロールすると動画は右下に小さくなって再生を続けます。字幕は閲覧言語に合わせて切り替わります。
閲覧言語2 言語で読めます
この記事はまだ日本語に翻訳されていないため、英語の原文を表示しています。
要約

30 秒でわかる

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.

ポイント

  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.
全文

チャプターごとに整えた全文を読む

文字起こしのみ
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
スライド 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
スライド 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
スライド 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.

同じチャンネルの記事

スライド 12 枚34:21EN
Matthew Berman· 2026年10月27日Matthew 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 Safetyエンタープライズ AI+2
スライド 2 枚0:36EN
Matthew Berman· 2026年10月25日Kimi 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.評価(Evals)コーディングエージェントOpen-weight models
スライド 6 枚25:50EN
Matthew Berman· 2026年10月24日Kimi 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 枚32:20EN
Matthew Berman· 2026年10月23日Who 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 枚1:03:37EN
Matthew Berman· 2026年10月23日Matthew 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.コーディングエージェントGenerative media評価(Evals)+2
0:53EN
Matthew Berman· 2026年10月22日Sam 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