0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RaspberryPi5にローカルLLMをインストールし、コード入力補完する

0
Posted at

ollama(オラマ)をインストールする

ターミナルを起動し、以下のコマンドを実行してください。

curl -fsSL https://ollama.com/install.sh | sh

モデルをインストールする

Alibabaが公開している以下のコーディング特化モデルをインストールします。

  • Qwen 2.5 Coder 7B (qwen2.5-coder:7b)
    用途: チャットでのコード生成、バグ修正、設計相談、リファクタリング
  • Qwen 2.5 Coder 1.5B (qwen2.5-coder:1.5b-base)
    用途: エディタでのリアルタイムな「コード入力補完(オートコンプリート)」

以下のコマンドを実行してください。

ollama pull qwen2.5-coder:7b
ollama pull qwen2.5-coder:1.5b-base

VS Codeに「Continue」をインストールする

Raspberry PiでVS Codeを起動してください。
左側の拡張機能アイコン(ブロックのマーク)をクリックしてください。
検索バーに Continue と入力してください。
Continue - Llama 3, GPT-4, Claude 3... という名前の拡張機能が表示されたら「インストール」をクリックしてください。

ContinueにOllamaとの紐付けを設定する

Continueのアイコンをクリックしてサイドバーを開きます。
設定画面の右上の「Local Config」をクリックしてください。
「Local Config」にカーソルを合わせると表示される歯車のアイコンをクリックしてください。
config.yamlという設定ファイルが開くので、内容を以下のように書き換えます

name: Local Config
version: 1.0.0
schema: v1
models:
 - name: qwen2.5-coder 7B
   provider: ollama
   model: qwen2.5-coder:7b
   roles:
     - chat
     - edit
     - apply
 - name: Qwen2.5-Coder 1.5B
   provider: ollama
   model: qwen2.5-coder:1.5b-base
   roles:
     - autocomplete
 - name: Nomic Embed
   provider: ollama
   model: nomic-embed-text:latest
   roles:
     - embed

以上です。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?