作業用PCでローカルLLMを動かしてみる

私は普段、開発する際には Linux が入った PC に SSH して作業をしています。というのも、デスクトップPCは Windows でラップトップは MacBook というように OS が違い、メンテが大変なためです。

専用の作業 PC を用意しておけば、どこからでも自分の環境にアクセスできます。 PC は中学卒業タイミングで組んだ自作PCで、Intel Core i-5 4690 や DDR3 の 16GB メモリ、GTX1060 と古の構成です。今ではほとんど価値がないというのはわかっていますが、 Linux を動かす際には特に支障はないので一旦はこれで満足しています。

さて、そんなPCですが昨今の AI ブームの波に乗ってみたいと思いました。はい、ローカルLLMです。GTX1060 ではどれくらいのモデルが動くのか?気になります。

とりあえず Claude に聞いてみる

さて、なにも考えずにデカLLMを入れるのは賢くありません。モデルごとに推奨環境があるのでとりあえずその中から一番いいモデルを入れてみます。ということで、雑に Claude に聞いてみたところ qwen3:8b が良いとのことなのでこれを使って検証をしていきます。また、qwen3.5:4b も合わせて試してみようと思います。

ollama.com

ollama.com

Tip

Qwen は中国アリババが開発しているLLMファミリー名です。
Qwen (Qwen) を見ると、最新は Qwen3.6 っぽい?その他、特化型LLMもたくさんあるみたい

また、今回は Ollama を使って行きます、一番有名っぽいので。特に理由はありません。

ollama.com

CLI から起動してみる

Note

今回は Arch Linux で起動します。

Ollama で推論するために、nvidia の GPU を使うなら CUDA に対応する必要があります。 ollama-cuda をインストールすればOK*1ですが、 GTX1060 は古すぎてなんとサポート対象外とのことでした。

nvcc fatal: Unsupported gpu architecture 'compute_61'

そのため、別のアーキテクチャである Vulkan を使って解決を行いました。ollama-vulkan に切り替えたところ問題なくGPUを認識できました。あとは以下のコマンドを動かすだけです。

# サーバ起動
ollama serve

# pull
ollama pull qwen3:8b
# run
ollama run qwen3:8b

そして、動かした結果は以下です

ollama run qwen3:8b
>>> こんにちは
Thinking...
Okay, the user said "こんにちは" which means "Hello" in Japanese. I should respond in Japanese to keep the conversation natural. Let me make sure I use the correct greeting. Maybe "こんにちは!" and then ask how I can assist them. Keep it
friendly and open-ended. Let me check for any grammar mistakes. Yep, that looks good. Ready to respond.
...done thinking.

こんにちは!お手伝いできることがあれば、いつでもご相談くださいね。😊

GPU も使われていることがわかります。73%使われていますね。

Sat Jun 27 17:26:53 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.159.04             Driver Version: 580.159.04     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1060 6GB    Off |   00000000:01:00.0 Off |                  N/A |
| 24%   56C    P0            115W /  120W |    5253MiB /   6144MiB |     73%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            1247      G   labwc                                    33MiB |
|    0   N/A  N/A            1780      G   Xwayland                                  2MiB |
|    0   N/A  N/A          154921    C+G   /usr/lib/ollama/llama-server           5202MiB |
+-----------------------------------------------------------------------------------------+

質問した内容は「越谷市の名産品は?」です。返答できているのはいいのですが、「越谷うどん」や「越谷みかん」「越谷茶」なんてものは一切聞いたことない情報なのでいかにもハルシネーションしていることがわかります。まあ、8B なので性能はこれくらいかなとは思います。

「 越谷市の名産品は?」と質問してみた

>>> 越谷市の名産品は?
Thinking...
Okay, the user asked about the specialty products of Hachioji City. Let me start by recalling what I know about Hachioji. It's a city in Tokyo Prefecture, right? Known for its historical sites and maybe some local products. Wait, I should make
sure I'm not confusing it with another city. Let me double-check.

Hachioji is a city in Tokyo, located in the southern part of the prefecture. It's famous for its historical significance, like the Hachioji Castle ruins. But when it comes to local specialties, I need to think about what's unique to the area. I
remember that Hachioji has some traditional crafts. Oh, there's the Hachioji Tanabata Festival, which is a big event, but that's more of a cultural event than a product.

Wait, maybe there are specific foods or crafts. Let me think. There's a type of local sake called Hachioji sake, but I'm not sure if that's a major specialty. Also, there's a famous confectionery called "Hachioji Daifuku" or something similar.
Oh, right! Daifuku is a type of sweet rice cake, and Hachioji might have a specific variety.

Another possibility is traditional crafts like ceramics or textiles. I think Hachioji has some pottery, maybe from a local kiln. Also, there might be local vegetables or fruits that are grown there. For example, certain types of mushrooms or
vegetables that are unique to the region.

I should also consider any historical products. Since the city has a history of being a samurai town, perhaps there are traditional weapons or tools, but that might be more of a historical interest than a current specialty.

Wait, maybe there are specific local dishes. For instance, "Hachioji-style" dishes that use local ingredients. I should also check if there are any famous local brands or companies that produce goods unique to the area.

Another angle is traditional festivals or events that might have associated products, like crafts or food items sold during the Tanabata festival. Also, considering the proximity to Tokyo, maybe there are products that are popular in the Tokyo
area but originated in Hachioji.

I need to make sure I'm not mixing up Hachioji with other cities. For example, Hachioji is different from Hachimantai or other cities in Tochigi Prefecture. So, focusing on Tokyo's Hachioji.

In summary, the main specialties might include local confections like Daifuku, traditional crafts such as pottery, local sake, and perhaps specific agricultural products. I should list these with some details to give a comprehensive answer.
...done thinking.

越谷市(ごうのうし)は、東京都南東部に位置する市で、歴史的にも文化的にも注目すべき特産品があります。以下にその代表的な名産品を紹介します:

---

### 1. **越谷の「うどん」**
- **特徴**:越谷市は「うどんのまち」として知られ、特に「**越谷うどん**」が有名です。小麦粉と水だけで作られ、コシのある歯ごたえが特徴です。
- **名物**:「**越谷うどん**」は、熱湯に投入すると柔らかく、スープや出汁に絡みやすいのが特徴。地元の老舗うどん屋さんでは、天かすやネギをトッピングした「**天かすうどん**」が人気です。

---

### 2. **越谷の「手づくりうどん」**
- **特徴**:手作りのうどんは、小麦粉を練って手で伸ばして作る伝統的な製法で、コシと弾力があるのが特徴です。
- **名物**:地元の飲食店では、シンプルな味噌ダレや出汁で味わう「**手づくりうどん**」が定番です。

---

### 3. **越谷の「みかん」**
- **特徴**:越谷市は「みかんのまち」として知られ、特に「**越谷みかん**」が有名です。甘みが強く、果汁が豊富な特産品です。
- **名物**:地元の農家では、**みかんジュース**や**みかんゼリー**などの加工品も販売されており、観光客にも人気です。

---

### 4. **越谷の「手織り布」**
- **特徴**:越谷市には伝統的な手織り技術が残っており、地元の工房で作られる「**越谷手織り布**」があります。繊細な織り目で、和服や小物に使われることが多いです。

---

### 5. **越谷の「お茶」**
- **特徴**:越谷市では、平成初期に「**越谷茶**」のブランドが立ち上げられ、地元の茶農家が栽培するお茶が特産品です。特に、**高級抹茶**や**紅茶**が有名です。

---

### 6. **越谷の「伝統的な工芸品」**
- **特徴**:越谷市には、陶芸や漆器などの伝統工芸品の工房が点在しています。特に、**陶器**や**漆器**が地元の工芸士によって作られ、地域の文化として受け継がれています。

---

### 7. **越谷の「地酒」**
- **特徴**:越谷市には、地元の酒蔵がいくつかあり、**越谷の地酒**が特産品として知られています。特に、**米酒**や**焼酎**が人気です。

---

### まとめ
越谷市の名産品は、**うどん**や**みかん**といった食品、**手織り布**や**伝統工芸品**といった文化製品、そして**地酒**など多岐にわたります。観光や地元のイベントでこれらの特産品を楽しむことができますよ!

なんかもっと大きいモデルでも行けそう

試した感じもっと大きいモデルでも体感行けそうだったので qwen3.5:9b でも試そうと思います。

ollama.com

ollama pull qwen3.5:9b

なんか「こんにちは」と送ったらめちゃくちゃ考えられた。ワラ

「こんにちは」の返答

>>> こんにちは
Thinking...
Thinking Process:

1.  **Analyze the Input:**
    *   Input: "こんにちは" (Konnichiwa)
    *   Language: Japanese
    *   Meaning: Hello / Good afternoon
    *   Intent: Greeting, starting a conversation.

2.  **Determine the Appropriate Response:**
    *   Acknowledge the greeting politely.
    *   Offer assistance or ask how I can help.
    *   Maintain the same language (Japanese).
    *   Keep it friendly and helpful.

3.  **Drafting Responses (Internal Monologue/Trial):**
    *   Option 1: こんにちは。どうされましたか? (Hello. What's up?) - A bit too casual for some contexts, but okay as a standard AI greeting.
    *   Option 2: こんにちは!何かお手伝いできることはありますか? (Hello! Is there anything I can help you with?) - Polite and helpful.
    *   Option 3: おはようございます。(Good morning) - No, time of day isn't specified, "こんにちは" is the standard greeting response. Wait, if they said Konnichiwa, responding similarly or slightly warmer is good.

4.  **Selecting the Best Response:**
    *   Standard polite Japanese (Desu/Masu style).
    *   Express willingness to help.
    *   Example: "こんにちは!お元気ですか?何かお手伝いできることがあれば、お気軽におっしゃってください。" (Hello! How are you? If there's anything I can do, please feel free to ask.)

5.  **Refining for Conciseness and Friendliness:**
    *   "こんにちは!今日も一日いかがお過ごしでしょうか?何かお手伝いできることがありましたら、喜んでサポートいたします。" (Hello! How have you been today? If there's anything I can help with, I'd be happy to support.) -> A bit long.
    *   Simpler: "こんにちは!今日はどのようなご用件でいらっしゃいますか?私に何ができてもよいのですが、よろしくお願いいたします。" (A bit stiff).
    *   Balanced approach: "こんにちは!何かお手伝いできることはありますか?お気軽にお話しください。"

6.  **Final Polish:**
    *   Greeting match: こんにちは!(Hello!)
    *   Offer help: お手伝いできますか?(Can I help?) / ご活用いただければ幸いです。(It would be a pleasure if you use me.) -> Maybe too formal.
    *   Friendly AI persona: "こんにちは!何かお手伝いできることはありますか?"

7.  **Final Output Generation (Japanese):**
    こんにちは!何かお手伝いできることがありましたら、お気軽におっしゃってくださいね。今日はどのようなことができますか?

    Let's make it natural and warm.

    "こんにちは!お元気ですか?何についてでもご相談ください😊" (Hello! Are you well? Talk to me about anything 😊) -> Emojis add friendliness but maybe keep text clean unless needed.
    Standard polite: こんにちは。何かお手伝いできることはありますか?

8.  **Decision:** Go with a standard polite greeting offering assistance.

    "こんにちは!何かお手伝いできることがありましたら、お気軽におっしゃってくださいませ。" (Hello! If there is anything I can help you with, please feel free to say so.)
    Or simpler: "こんにちは!今日はどのようなご用件でしょうか?私に何ができそうですか?" -> No.

    Let's stick to the classic AI greeting style in Japanese.
    "こんにちは!何かお手伝いできることはありますか?" (Hello! Is there anything I can help you with?)

9.  **Final Check:** Does this match the user's language? Yes. Tone is appropriate.

    *Revised:* こんにちは!今日も良い一日をお過ごしくださいね。何かお手伝いしたいことがあれば、いつでもおっしゃってくださいませ。😊 (Hello! Hope you have a good day today. If there's anything I can help with, feel free to ask anytime.) -> Adding
emoji makes it friendlier but maybe text-only is safer for broad contexts. Let's add one or two emojis to keep it light.

    Actually, keeping it slightly more professional yet friendly is usually best unless instructed otherwise.
    "こんにちは!何かお手伝いできることがあれば、お気軽にお話しください。"

10. **Final Output Construction:**
    こんにちは!何かお手伝いできることはありますか?
    (Hello! Is there anything I can help you with?)

    Let's add a bit more warmth.
    "こんにちは!お久しぶりですね... wait, no."
    Just a standard greeting response.

    "こんにちは!今日は何をされましたか?" -> No.
    "こんにちは。何かお手伝いできることがありますでしょうか。" (Hello. Is there anything I can help you with?)

    Okay, I will output: こんにちは!何かお手伝いできることがありましたら、お気軽におっしゃってくださいね😊

11. **Final Output:** (Matches the thought above)
    "こんにちは!今日も一日元気でいてくださいね。何かお手伝いすることはありますか?" -> Simple and kind.cw

    Let's go with: こんにちは!何かお手伝いできることはありますでしょうか?🤗
...done thinking.

こんにちは!今日も良い一日をお過ごしください😊

何かお手伝いできることがありましたら、お気軽におっしゃってくださいませ。

とはいえ、3.5:9Bでも結構問題なく動きますね。とはいえ、 3:8B のほうが体感良いですね。

Web 経由でアクセスできるようにする

さて、次に Web UI 経由でアクセスしたいと思います。今回は Open WebUI を使いました。

github.com

ollama を systemctl で設定しつつ、ホストを 127.0.0.1 から 0.0.0.0 にします。セキュリティ的にちょっと怪しいですが非公開サーバーなので一旦ここは目を瞑ります。

Open WebUI 起動ができ、モデルが読み込めた

ということでチャットできました!めでたい!

ということで今回の遊びはこれくらいにします。ではでは