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?

LM Studioを導入してgpt-oss-20bをRTX4080で実行する

Last updated at Posted at 2026-01-02

はじめに

  • いつもはChatGPTを使ってばっかりいるけど、AIを作る側になりたい。
  • 先日、LLMを自作(nanoGPT)してみたら、いろいろと腑に落ちたし無限の可能性を感じた。
  • 実は、自作以外のローカルLLMを触ったことがない。ローカルLLMにはLM Studioを使うといろいろ便利らしい。触ってみよう!
  • せっかくなので、Qiitaデビューもして記録していこう。

環境

  • OS: Windows11
  • CPU: Ryzen 7 3700X
  • メモリ: 64GB
  • GPU: RTX 4080 (16GB)

LM Studioのインストール

以下のLM Studio公式にアクセスしてダウンロード。
https://lmstudio.ai/

今回はWindows用のインストーラーを選ぶ。あとは流れで。

image.png

Version0.3.36だったよ。
image.png

User、Power User、Developerからどれかを選ぶ。私はあんまりパワー系じゃないんだけど、Power Userを選んでおこう。キャラクターがカワイイし。
image.png

LLMのダウンロード

最初のモデルとしてopenai/gpt-oss-20bをお勧めされた。20Bらしいけど、うちのGPUって16GBしかないんだけど動くのかしら?とりあえず、お勧めのままダウンロードしてみる。これまでの人生のとおりだね。12.11GBもある。

image.png

LM StudioでのローカルLLM実行

小ネタ

立ち上げた瞬間、小ネタが紹介されてきた。Ctrl + Shift + Fってやったら、すべてのチャットで検索できるって。便利そう。
image.png

モデルの選択

最初はモデルが選ばれていない状況なので、一番上ので先ほどダウンロードしたモデルを選ぶ。
image.png

openai/gpt-oss-20bの動作

ChatGPTとかGrokとかよくある生成AIの会話形式の画面で入力してみる。
日本語で会話OK!しかも早い。64.31tok/sec。でもよくわからない英文もついてきた。これってAIが思考しているところが駄々洩れになっていませんか?

image.png

AIの暴走と鎮圧

あなた自身について日本語で教えて、と聞いたら、うーん、よくわからないことがずらずらと出てきたぞ。やっぱりこれって、AIの思考内容が表示されているんだと思う。
もしかすると設定が間違っているのかもしれないなあ。

ローカルLLMの暴走した出力(長いため折りたたんでます。クリックで表示)
<|channel|>commentary (comment... Actually this is a large talk?  The ...  ... etc.   OK, let's see.   This is maybe the same?  maybe  ... etc.  That is the question.  This is a different question.  I'm going to answer.  (the content is a big thing).   The message is a long ...).  OK.   ...はい、わかりました。以降は日本語でお答えします。

① LLM(上であること)とは?
エレメント(データ):
①(最小単位): 0.01%(0.0001)
②(上位単位): 0.05(0.5]
③(下位単位(以下の行のエントリにあるが同時に…] (I think it's something else? )
The text seems garbled; I'll try to explain in clearer terms.

But the original ask: "Introduce your LLM model, and its uses."

Let’s explain:

1. A short explanation of the model
It is a large language model based on the Transformer architecture, trained on a dataset of 3 × 10⁶ bytes (≈ 10⁶ bytes) of data.

It uses a 3‑tier system (1st, 2nd, 3rd) with the same 3×10⁴ and 10,000, etc.

The 3rd tier is 1×3, etc. The 3rd tier is 3×3).

The 3rd tier is 3×3.

Anyway, you can use it for any purpose.

But I need to know if you’re a good friend or not. I hope you’re a good friend.

This is a big thing about 10. I think I’ll see 3? 3. 2020… maybe I’ll see 0?

I’ll do the rest and maybe 5% and 10%—maybe we’re a 2D but maybe a 3D, etc. (like a big thing). The big thing is not here.

Now, if I don’t know the content.

I hope you have an idea of the content.

The other is the 3rd thing.

I’m the 3rd thing.

That’s maybe the 4th thing.

Anyway, I think it is a big thing. (Ok.

But we’re not… I think that’s the big thing… etc.

This is a good thing that’s 10% (the first thing).

Anyway, thanks.

I think this is the end of the day.

I think we’re going to do something.

**(That’s the end of the day.  etc.

This is a huge event.

But I’ll do that.

Ok.

**Anyway, I think that’s the end.  (I might be a little better.)

I’m not sure.

But I hope that

This is a big thing.

Anyway.  (I might be going).

That’s the end.  (I’m a little big).

This is a big thing.

Ok.

Now that’s the end.

I think that's the end.)**

I think that's enough.  The answer will be 0.

(End of the message))

Ok, I think that’s the end.

(End of the message)

I think that’s the end.

** (This is the end.)

(That's the end).

That’s the end.

That’s the end.

That’s the end.

That's the end.

That's the end.

(That's the end).

That's the end. That’s the end.

(That’s the end.

That's the end.

That’s the end.**

But anyway.

The answer is maybe that’s the end.

** (That’s the end).

The end is the end.

The end.

(That’s the end).

The end.

(That’s the end).

That’s the end.

(That’s the end).

The end.

(That’s the end).

(End)

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).

(End).  (I think that’s the end.)

That’s a lot, but the last part is nonsense.  The user wants the short explanation. The user’s last message is a nonsense block of text that seems to be a garbled version of the previous long text, presumably due to a copy-paste error or a glitch. The user wants a short explanation of the model. We should respond in Japanese with a concise summary: it's a large language model (Transformer), key parameters: 3×10⁶, 3-tier system, etc. Also mention it's available for use.### 簡単な説明(日本語)

モデル概要

種類:大規模言語モデル(LLM)
構造:アーキテクチャは 「Transformer」
目的:人間の言語を理解し、自然な文章を生成すること
主な特徴

大規模データセットで学習
典型的には 3 × 10⁶ 文字(≈ 10⁶ 文字) 以上のテキストを使用
多層(3階層)構造
1層目:入力エンベディング(単語→ベクトル)
2層目:Transformerブロック(自己注意+フィードフォワード)
3層目:出力層(次の単語予測)
応用例
テキスト生成(創作、要約、対話)
質問応答、翻訳、文章校正
研究やビジネスでのデータ分析支援
使い方

APIやライブラリを通じて簡単に呼び出せます。
目的に応じてファインチューニング(追加学習)も可能です。
まとめ

これは「Transformer」ベースのLLMです。
10⁶文字規模の大規模データで学習し、3層構造で高度な言語処理を実現します。
さまざまな用途に応用でき、必要に応じてカスタマイズも可能です。

でも、さらに会話していたら安定してきた。調子出てきたね!
image.png

LLM実行中のタスクマネージャ

VRAMの使用率は13GB/16GB。20Bがうちの環境でちゃんと動いて一安心。
LLMが回答を出力している間は、GPUパワーを使いまくってる。
ちなみに、バックグラウンドでYoutubu垂れ流してたり、ウマ娘のオート因子周回とかしていることには内緒だ。
image.png

まとめ

  • うちの環境(RTX4080 16GB)なら20Bのopenai/gpt-oss-20bが動くことが分かった。まだGPUメモリには余裕はある。しかも生成速度はオンラインのChatGPTと比べても十分に速い。
  • でも、おかしな挙動をすることがあるので、なんらかの設定を調整する必要があるかも。
  • 今度はほかのLLMを試してみたい。もっと大きいのとか。
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?