Skip to main content
Glama

openlocal

オープンツール。ローカル頭脳。クラウドゼロ。

小さなローカルモデルが実際に使えるツールベルト — そしてそれを証明する実績。

CI PyPI Python Dependencies License


pip install openlocal
openlocal quickstart

以上です。quickstart は、あなたが既に動かしているモデルサーバー(ollama、LM Studio、llama.cpp、vLLM)を探し出し、設定を書き、あなたのモデルが実際に駆動できるツール呼び出しプロトコルを測定し、実際のタスクを実行して動作を確認します:

$ openlocal quickstart
openlocal quickstart - looking for a model server...
found ollama at http://127.0.0.1:11434/v1 with 6 model(s)
wrote ~/.openlocal/models.toml
default model: qwen3-4b  (served as qwen3:4b)
measuring which tool protocol this model can drive...
  -> native tool calling

demo: Read notes.md and tell me how many lines it has.
  tool     file_read
  final

  The file notes.md has 3 lines.

You are set up. Try:
  openlocal run "list the files here and summarise what this project is"
  openlocal eval          # score this model on 15 deterministic tool tasks
  openlocal mcp           # serve these tools to Claude Code over MCP

openlocal の理由

🪶 依存関係ゼロ

純粋な標準ライブラリ。数秒でインストール、Raspberry Pi でも動作、他人のリリースで壊れることはありません。

🔌 手元のものとそのまま連携

OpenAI /v1 API を話すものなら何でも。1つの URL、アダプター不要、アカウント不要。

📊 測定済み、主張なし

9ベンダー10モデル、17の決定論的タスクでスコア化。LLM 判定なし — すべてのチェックはファイル diff または正規表現。

🧰 1つのレジストリ、2つの表面

同じ8つのツールが MCP サーバー(Claude Code、任意の MCP クライアント)とローカルモデルエージェントループの両方を動かします。

🩹 実際の失敗で調整済み

ここにあるすべてのエルゴノミクスルールは、モデルが壊れた代償として得られました。教訓の表 は他では得られない部分です。

🧩 ベンダー追加は TOML 編集のみ

新しいモデルファミリー? families.toml を編集し、openlocal probe を実行し、PR を送信。Python は不要。

Related MCP server: Hermes MCP Server

リーダーボード

同じタスク、同じツール、1モデルずつ、各2回実行。tools は各モデルが測定上駆動したプロトコルであり、ドキュメントで主張されているものではありません。

model

vendor

tools

passed

pass rate

bad json

tok/s

qwen3.8-4b

Alibaba

native

17/17

100%

0

40.4

glm-4.7-flash

z.ai

native

17/17

100%

0

39.9

qwen3.8-27b

Alibaba

native

17/17

100%

0

16.6

nemotron-nano-4b

NVIDIA

native

16/17

94%

0

54.9

gemma-4-e4b

Google

native

16/17

94%

0

50.3

gpt-oss-20b

OpenAI

native

16/17

94%

45.3

granite-4.1-3b

IBM

native

15/17

88%

4

66.0

llama-3.1-8b

Meta

native

14/17

85%

2

33.4

mistral-small-3.2

Mistral

native

14/17

82%

0

11.1

phi-4-mini

Microsoft

native

13/17

79%

0

61.5

¹ gpt-oss のハーモニーパーサーは自身のツール呼び出しの一部を拒否します(llama.cpp が 500 を返す)。クライアントのリトライラダーはすべてを回復します — RESULTS.mdretries 列がそれを正直に記録しています。

再現するには:openlocal leaderboard --repeat 2

なぜあなたの小さなモデルはツールで失敗するのか

3B モデルが失敗するのは愚かだからではありません。ツールの出力がプロンプトであり、ほとんどのツール出力が人間向けに書かれているからです。以下のすべては測定されました — スコアが上がったときに維持され、上がらなかったときに差し戻されました。

何が壊れたか

修正方法

測定効果

「300行目は何?」→ モデルが311行目と回答

すべての行に番号を付ける:300| 行 300

モデル間で1ターンで修正

モデルが500行のファイルを1ターンに1行ずつ読み進めた

フッターは事実を述べ、コマンドは記述しない(「ファイルは続く」≠「もう一度呼び出して…」)

phi: 12の無駄なステップ → 2

ツール呼び出しではなく散文

ツールなしの散文=最終回答(ネイティブのみ)

phi: 51の不正な応答 → 5

…しかし「file_grep を使います」は計画

意図検出:計画は促され、回答は受理される

意図で終了する実行を防止

file_read(notes.md) がテキストとして入力された

散文の呼び出し構文を解析して実行

無駄なターンを排除

{"limit": None}、末尾のゴミ、分割されたオブジェクト

JSON 修復:括弧スキャン、末尾クローズ、Python リテラル、フラグメント結合

phi の不正JSON 5 → 0

モデルがソースを読む前にファイルを書き込んだ

終了時の古い書き込み検出

llama: 13 → 15 / 15

モデルが「44」と推測し、促されても繰り返した

1ターンの tool_choice: "required"

granite がタスクを回復

4行のCSVを完全に読んだのに合計を40と言った

calc ツール — および読み取り前に使用できないガード

granite: +2タスク

ソースを読まずに出力ファイルを書き込んだ

終了時の「thin-air」書き込み検出

qwen-4b が MCP 経由で回復

N| 参照プレフィックスを編集ターゲットにコピーした

file_edit は生テキストが一致しない場合にそれを除去

edit_code: 10/10 モデルが合格

同じ呼び出しを永遠に繰り返す(A→B→A→B)

繰り返しガードがキャッシュ結果を再生

llama のページネーションループ解消

サーバーが自身のツール呼び出し構文で500を返す

リトライラダー:そのまま→ウォーマー→同じターンで tools なし

gpt-oss: 11/15 → 14/15

差し戻し: もう1つのシステムプロンプトルール

granite 12/15 → 11/15。ルールは少ない方が勝つ。

MCP はファーストクラス市民であり、ラッパーではない

openlocal eval --via-mcp は、評価スイート全体を実際の stdio MCP サーバーで提供されるツールで再実行します — スキーマがワイヤーを越え、結果がコンテンツブロックとして、タスクごとにサブプロセスが生成されます。スコアはインプロセス数値と一致します — それがポイントです:Claude Code が経験するものは、測定されたものなのです。

Claude Code(または任意の MCP クライアント)から使用する

pip install "openlocal[mcp]"
claude mcp add openlocal -- openlocal mcp

あなたのローカルモデルが使うのと同じ10個のツールが、今や Claude Code で使えます。finish は残されません — それはループ制御であり、能力ではありません。

コマンド

openlocal quickstart              # find a server, configure, probe, demo
openlocal run "goal"              # agent loop over your tools
openlocal run "goal" --url http://host:1234/v1     # no config at all
openlocal chat "hello"            # one plain turn, no tools
openlocal tools                   # what the model can call
openlocal probe                   # measure native vs JSON tool calling
openlocal eval                    # 17 deterministic tasks, pass/fail
openlocal eval --via-mcp          # same tasks, tools served over a REAL MCP server
openlocal leaderboard --repeat 2  # every configured model, one table
openlocal mcp                     # stdio MCP server
openlocal models / serve / stop / status / pull    # local llama-server management

smol は同じ CLI の短いエイリアスです。

設定

ワークスペースは ~/.openlocal(または models.toml を含む任意のディレクトリ、あるいは $OPENLOCAL_HOME)です。そこには models.tomlstate.json、ログ、ダウンロード、評価結果が格納されます — インストールされたパッケージは決して含まれません。

[engine.ollama]
type = "external"
base_url = "http://127.0.0.1:11434/v1"

[[model]]
id = "qwen"
engine = "ollama"
family = "qwen"              # tells openlocal this vendor's tool-calling quirks
served_model = "qwen3:4b"    # the exact name the backend knows
default = true

環境変数

デフォルト

意味

OPENLOCAL_HOME

~/.openlocal

ワークスペースディレクトリ

OPENLOCAL_BASE_URL

すべてのコマンドを1つの /v1 サーバーに向ける

SMOL_ROOT

cwd

ファイルおよびシェルツールのサンドボックスルート

SMOL_MAX_CHARS

8000

1つのツール結果のハード上限

SMOL_SHELL_ALLOW

開発コマンド

カンマ区切りリスト、または *

SMOL_TOOL_TIMEOUT

120

MCP ツール呼び出しが放棄されるまでの秒数

ツール

file_list(path=".")                       list files and folders
file_read(path, start_line=1, limit=200)  read a file, one page at a time
file_write(path, content)                 write a file
file_edit(path, find, replace)            replace text exactly, leave the rest alone
file_append(path, content)                add to the end without touching what exists
file_grep(pattern, path=".")              search files
web_search(query, limit=5)                search the web (DuckDuckGo, or Tavily via key)
web_read(url, offset=0, max_chars=4000)   read a page as text
shell_run(command, timeout=60)            run one allowlisted command
calc(expression)                          exact arithmetic - models cannot count
finish(answer)                            agent loop only: end the task

テストで強制されるハウスルール:デフォルト値付きのフラット引数、すべての説明にサンプル呼び出し、1行の結果ヘッダー、真実の継続ヒント付きのハードキャップ出力、そして次の行動を指示するエラーno such file: x - call file_list(".") to see the files that exist

アーキテクチャ

tools/          one registry  →  mcp_server.py   (Claude Code speaks MCP to it)
                              →  agent.py        (a local model calls the same tools)
_http.py        the entire network layer, on urllib (this is why deps = 0)
runner.py       external servers, or llama-server processes it starts and owns
protocol.py     native tool_calls → loose JSON → repair → symptom-specific nudge
families.toml   per-vendor quirks as DATA - the file contributors edit
evals/          17 deterministic tasks + a leaderboard across models

コントリビューション

モデルファミリーの追加に Python は不要:families.toml を編集し、あなたのモデルを models.toml に追加し、次を実行します

openlocal probe --model your-model
openlocal eval  --model your-model

そして結果の行を PR に貼り付けます。詳細は CONTRIBUTING.md を参照してください。

AMD ハードウェア(ROCmFP4 + MTP 投機的デコード)でローカル GGUF モデルを実行する方法は docs/ENGINE.md に文書化されています — オプションであり、上記に必要ではありません。

ライセンス

MIT © DevXV3

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    A lightweight and fast MCP server that enables AI agents to efficiently discover and execute tools through progressive disclosure, minimizing context consumption while supporting safe code execution in external environments.
    12
  • F
    license
    Not graded
    quality
    B
    maintenance
    A lightweight Node.js MCP server with zero dependencies offering 9 built-in tools for system info, web fetching, GitHub search, file operations, shell execution, and key-value memory, enabling AI agents to perform these tasks via the Model Context Protocol.

View all related MCP servers

Related MCP Connectors

  • Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DevXV3/openlocal'

If you have feedback or need assistance with the MCP directory API, please join our Discord server