0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

管理者権限なしでローカル LLM を動かす(Qwen3・llama.cpp・Windows)

Last updated at Posted at 2025-05-17

前提

社用PCでは管理者権限が必要な操作を行うたびに申請が必要で、ローカルLLMを導入するハードルが高い状況です。
同じ悩みを持つ方の参考になればと思い、今回は 管理者権限なし で環境構築から利用までできた手順をメモとしてまとめました。

テスト環境

項目 内容
CPU AMD Ryzen 7 5825U
RAM 24 GB
OS Windows 11(標準 PowerShell 5.1 使用)

準備

ツール 入手先 ポイント
llama.cpp (バイナリ ZIP) https://github.com/ggml-org/llama.cpp/releases llama-run.exe などが入った ZIP を解凍してそのまま使用します
pip install llama-cpp-python は Visual Studio BuildTools が必要になるため今回は不使用
GGUF https://huggingface.co/Qwen/Qwen3-1.7B-GGUF/tree/main 今話題の Qwen3 1.7 B をテスト用に取得
PowerShell Windows 標準 スクリプトではなく 「対話入力」 で実行します。

実践手順

1. 文字化け対策(UTF-8 切り替え)

PowerShell の入力・出力のエンコーディングを明示的に UTF-8 に設定する。

[Console]::InputEncoding  = [Text.Encoding]::UTF8;[Console]::OutputEncoding = [Text.Encoding]::UTF8

実行コマンド

.\llama-run.exe .\Qwen3-1.7B-Q8_0.gguf

> が表示されたら準備完了。質問を入力する。

オプション

思考モードの切り替えは、 /no_think

思考モード ON (デフォルト)

PS > .\llama-run.exe .\Qwen3-1.7B-Q8_0.gguf
> こんにちは!
<think>
Okay, the user said "こんにちは!" which is Japanese for "Hello!" I need to respond in Japanese. Let me make sure to use a friendly and polite tone. Maybe say "こんにちは!" back. But wait, should I add something else? Like a greeting or a question? Maybe ask how I can help them. Let me check the guidelines. The user wants a response in Japanese, so I'll go with a simple hello and offer assistance. Yeah, that should work.
</think>

こんにちは!おはようございます。どうもあたし、AIアシスタントです。何かお手伝いできますか?
>

思考モード OFF

PS > .\llama-run.exe .\Qwen3-1.7B-Q8_0.gguf
> こんにちは! /no_think
<think>

</think>

こんにちは!はじめまして。何かお気軽にお知らせくださいね。😊
>

ファイルを指定して実行

長文で指示したりするときのやり方です。
以下は、PowerShell 7.5.1で動作確認しました。
(PowerShell 5.Xでは上手くいきませんでした...)

ChatMLサンプル

prompt.txt
<|im_start|>system
あなたは優秀な日本語のアシスタントです。全ての回答は日本語で答えてください。
<|im_end|>
<|im_start|>user
人間が快適に過ごせる室温は? /no_think
<|im_end|>
<|im_start|>assistant

実行コマンド

PS > [Console]::OutputEncoding = [Text.Encoding]::UTF8
PS > [Console]::InputEncoding  = [Text.Encoding]::UTF8
PS > type .\prompt.txt | .\llama-run.exe .\Qwen3-1.7B-Q8_0.gguf
<think>

</think>

人間が快適に過ごせる室温は、一般的に **20℃〜25℃** とされています。ただし、個人の体質や使用目的(例えば、寝室、ワークスペースなど)によっても異なります。

- **20℃〜22℃**:多くの人にとって「涼しい」温度です。
- **22℃〜25℃**:最も快適な温度範囲とされています。
- **25℃以上**:暑く感じる場合があります。
- **18℃以下**:冷たいと感じることがあります。

また、湿度も影響します。湿度が高ければ、25℃でも暑く感じられることがあります。逆に湿度が低ければ、20℃でも冷たいと感じる場合もあります。

ご自身の体感温度や用途に合わせて調整してください。

まとめ

  • ZIP 配布ツールだけ を使えば **管理者権限不要 ** でWindowsにローカルLLM環境を構築できる
  • PowerShellはInput/OutputEncodingをUTF-8 にすると文字化けしない
  • Qwen3では、思考モードと非思考モードを /no_think で切り替えることができる
  • ファイルを指定して指示することもできる
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?