こんにちは、ナナオです。

突然ですが、ローカルLLM使っていますか?

私は使いたいのですが、デスクトップもメモリもよわよわすぎて、なかなか使うのに奮闘しています。

今回は私が使ってきたモデルの一覧を紹介しようと思います。

使っているPCのスペックは以下の通り。

CPU: AMD Ryzen 9 3900 メモリ: 24GB GPU: GeForce GTX 1660 SUPER

使ったプロンプトは、opencodeの/initコマンドを実行した際の以下の一文(一部改変しています)

Please analyze this codebase and create an AGENTS.md file containing:
1. Build/lint/test commands - especially for running a single test
2. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc.
The file you create will be given to agentic coding agents (such as yourself) that operate in this repository. Make it about 150 lines long.
If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them.
If there's already an AGENTS.md, improve it if it's located in <プロジェクトディレクトリ>

Pythonプロジェクト上で/initコマンドを実行し、プロジェクトディレクトリを読んでそれに合ったAGENTS.mdを出力するか検証しています。

実際に使ってみたモデル

gemma3:4b

tool callには正式には対応していないので、TEMPLATEで対応してみた。

FROM gemma3:4b
PARAMETER num_ctx 131072
TEMPLATE """{{- if .Messages }}
{{- if or .System .Tools }}<start_of_turn>user
{{- if .System}}
{{ .System }}
{{- end }}
{{- if .Tools }}
# Tools
You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:
<tools>

{{- range $.Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>

For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
{{- end }}<end_of_turn>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
{{- if eq .Role "user" }}<start_of_turn>user
{{ .Content }}<end_of_turn>
{{ else if eq .Role "assistant" }}<start_of_turn>model
{{ if .Content }}{{ .Content }}
{{- else if .ToolCalls }}<tool_call>
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments}}}
{{ end }}</tool_call>
{{- end }}{{ if not $last }}<end_of_turn>
{{ end }}
{{- else if eq .Role "tool" }}<start_of_turn>user
<tool_response>
{{ .Content }}
</tool_response><end_of_turn>
{{ end }}
{{- if and (ne .Role "assistant") $last }}<start_of_turn>model
{{ end }}
{{- end }}
{{- else }}
{{- if .System }}<start_of_turn>user
{{ .System }}<end_of_turn>
{{ end }}{{ if .Prompt }}<start_of_turn>user
{{ .Prompt }}<end_of_turn>
{{ end }}<start_of_turn>model
{{ end }}{{ .Response }}{{ if .Response }}<end_of_turn>{{ end }}"""

それっぽい一文は出るが、tool callは発生しなかった。

gemma3:12b

上のgemma3:4bと同じく、TEMPLATEを設定し実行した。

パラメータ数を増やしてみたら動くか?と思って動かしてみたが、やはりtool callは発生しなかった。

qwen2.5:7b

以下のようなそれっぽい出力は出たが、tool callは発生せず。

{name: ls, arguments: {path: /home/nanao/Project/personal/mokumoku-bot}

hhao/qwen2.5-coder-tools:7b

qwen2.5:7bと同じく出たが、結局tool callは動かず。

ministral-3:8b

コードも読まずに推測でAGENTS.mdを吐き出す。

llama3-groq-tool-use:8b

コードも読まずに推測でAGENTS.mdを(ry

gpt-oss:20b

この中では一番まともに動いていた。

一部コードを読んだりした形跡があったので、globツールを使えていそうな感じがあった。

が、コード出力はできず。。

感想

やはりパラメータ数が多いのが正義なのか、という結果になった。

ただ当方の環境では20bもあるとopencode以外のタスクをすべて閉じないとまともに動かなかったので、開発と並行しながら動かすには別途サーバーを用意する必要がありそうだ。

新しくPC自作したいけど、メモリ高すぎる。。