Ollama モデルテスター(GitHub リポジトリ)
本文の状態
日本語全文を表示中
詳細モードで約3分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
TLDR AI
Ollama が提供するモデルテストツールが GitHub で公開された。このリポジトリは、ユーザーがローカルで実行する Ollama のモデル性能を検証・評価するための環境を提供している。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Ollama Model Tester
Ollama のローカルモデルに対して同じプロンプトを実行し、すべての応答をディスクに保存する、依存関係のない小さな CLI です。これにより、モデル同士(または同一モデルの繰り返し実行結果)を並列で比較することが可能になります。
Python 標準ライブラリのみを使用するため、pip install の必要はありません。
要件
- Python 3.7 以降
- ローカルで動作している Ollama(デフォルトは http://localhost:11434)
- 少なくとも 1 つのモデルがダウンロードされていること(例:ollama pull llama3.1:8b)
クイックスタート
Ollama が実行中であることを確認し、その後以下を実行してください。
python3 ollama_model_test.py
以下の質問が順次表示されます。
- 使用するモデル(インストールされているモデルから番号を選択)
- プロンプト — 好きな行数を入力し、終了するには /done を独立した行に入力します
- プロンプトの実行回数
- Temperature(0.0–2.0)、または Enter キーを押して Ollama のデフォルト値を使用
- 応答をターミナルにリアルタイムでストリーミングするかどうか
その後、指定された回数为プロンプトを実行し、結果は ollama-runs/ ディレクトリ下に書き込まれます。
コマンドラインフラグ(オプション)
上記のプロンプト入力はすべて事前に指定可能であり、これによりツールをスクリプトとして利用できます。省略した項目については対話形式で質問されます。
Flag
Description
--model NAME
使用するローカルモデル(すでにインストールされている必要があります)
--runs N
実行する生成回数
--temperature T
Temperature 値(0.0–2.0)
--prompt-file PATH
UTF-8 テキストファイルからプロンプトを読み取る
--stream / --no-stream
応答をリアルタイムでストリーミングするか、しないか
例 — 保存されたプロンプトを対話なしで 3 回実行する:
python3 ollama_model_test.py \
--model llama3.1:8b \
--prompt-file prompt.txt \
--runs 3 \
--temperature 0.7 \
--no-stream
Output
結果は、プロンプトごとに 1 つのフォルダにグループ化されます:
ollama-runs/
what-are-the-main-tradeoffs-between_835562a4/
prompt.md # ハッシュとタイムスタンプを含むプロンプト
metadata.json # このプロンプトに対するすべての実行(モデル、タイミング、オプション)
llama3.1-8b.md # このモデルの応答と Ollama の実行メタデータ
gemma3-1b.md
フォルダ名は、プロンプトの最初の数単語に、フルプロンプトの短いハッシュを付加したものです。フォルダがプロンプトに基づいてキー付けされているため、異なるモデルに対して同じプロンプトを実行すると、その出力も同じフォルダに格納されます。これにより、モデル間の比較が容易になります。各モデルのファイルには、Ollama の実行メタデータ(トークン数、タイミングなど)とともに、すべての実行の応答が記録されます。
原文を表示
Ollama Model Tester
A small, dependency-free CLI for running the same prompt against your local
Ollama models and saving every response to disk — so you
can compare models (or compare repeated runs of one model) side by side.
It uses only the Python standard library: no pip install required.
Requirements
- Python 3.7 or newer
- Ollama running locally (the default http://localhost:11434)
- At least one model pulled, e.g. ollama pull llama3.1:8b
Quick start
Make sure Ollama is running, then:
python3 ollama_model_test.pyYou'll be asked, in order:
- Which model to use (pick a number from your installed models)
- The prompt — type as many lines as you like, then put /done on its own
line to finish
- How many times to run the prompt
- Temperature (0.0–2.0), or press Enter to use Ollama's default
- Whether to stream the responses live to the terminal
It then runs the prompt the requested number of times and writes the results
under ollama-runs/.
Command-line flags (optional)
Every prompt above can be supplied up front, which makes the tool scriptable.
Anything you omit is still asked interactively.
| Flag | Description |
|---|---|
--model NAME | Local model to use (must already be installed) |
--runs N | Number of generations to run |
--temperature T | Temperature, 0.0–2.0 |
--prompt-file PATH | Read the prompt from a UTF-8 text file |
--stream / --no-stream | Stream responses live, or don't |
Example — run a saved prompt three times, fully non-interactive:
python3 ollama_model_test.py \
--model llama3.1:8b \
--prompt-file prompt.txt \
--runs 3 \
--temperature 0.7 \
--no-streamOutput
Results are grouped into one folder per prompt:
ollama-runs/
what-are-the-main-tradeoffs-between_835562a4/
prompt.md # the prompt, with its hash and timestamp
metadata.json # every run against this prompt (model, timing, options)
llama3.1-8b.md # responses + Ollama metadata for this model
gemma3-1b.md
The folder name is the first few words of the prompt plus a short hash of the
full prompt. Because the folder is keyed on the prompt, **running the same
prompt against a different model drops its output into the same folder** —
making model-to-model comparison easy. Each model's file records every run's
response alongside Ollama's run metadata (token counts, timings, and so on).
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み