Skip to main content

augllm

複数のローカル LLM ランタイムを共通のインターフェースで扱うための ラッパーライブラリです。エージェントのコア基盤として使えます。

  • 統一 API: どのバックエンドでも respond() だけで生成(テキスト / 画像 / 動画)。
  • 6 バックエンド: Transformers / llama.cpp(in-process・server)/ Ollama / MLX / mlx-vlm サーバー(Qwen3.6・Gemma 4 の MTP 高速化)。
  • VLM 自動判定・メディア統一: 画像 / GIF / 動画 / PDF を media= に渡すだけ。
  • MTP: ドラフトモデルで生成を高速化。
  • エージェント基盤向け: モデル/サーバー共有、確定的サンプリング、共通基底 BaseLLM。

インストール

uv を使います。

# 自分のプロジェクトに追加して使う
uv add augllm

# このリポジトリで開発する場合(依存をまとめて同期)
uv sync

使うバックエンドに応じた依存 (PyTorch / llama-cpp / Ollama / MLX 等)は docs/backends.md を参照してください。

使い方

サンプルコード

create_llm() で作り、respond() で生成します。main.py に保存して実行します。 LLMサーバーを立てて使う例です。

from augllm import create_llm

# mlx_server = mlx-vlm サーバー。draft_model="auto" で MTP(高速化)を有効化。
llm = create_llm(
    "mlx_server",
    model_path="mlx-community/Qwen3.6-27B-4bit",
    draft_model="auto",
)

for chunk in llm.respond(
    user_text="トポロジー最適化について 3 行で説明してください。",
    system_prompt="あなたは優秀な日本語アシスタントです。",
    stream=True,
):
    print(chunk, end="", flush=True)

# 使い終わったらモデル/サーバーを解放
llm.close()

画像・動画は media= に渡すだけ(close() の前に)。

llm.respond("この画像を説明して", media="assets/think1.png", stream=True)

実行方法

uv run python main.py

ドキュメント

各機能の詳細は docs/ を参照してください。 英語版 README は README.en.md にあります。

ドキュメント 内容
architecture.md アーキテクチャ・設計・エージェントコアとしての注意点
api-reference.md 統一 API・引数・メッセージ/履歴フォーマット
backends.md 6 バックエンドの詳細
media.md メディア入力とメッセージ変換
memory-management.md keep_alive・サーバー・自動相乗り
mtp.md MTP / 投機的デコード
function-calling.md YAML Function Calling
examples.md 応用レシピ(複数エージェントのサーバー共有・会話履歴・各バックエンドの詳細・Function Calling 等)とサンプルプログラム

公開先

PyPI: https://pypi.org/project/augllm/

ライセンス

本プロジェクトは Apache-2.0 ライセンス のもとで公開されています。 詳細は LICENSE を参照してください。

Release files for augllm 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for augllm 2.5.0
File Size Uploaded
augllm-2.5.0.tar.gz 9.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for augllm 2.5.0
File Interpreter ABI Platform
augllm-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 MB

Release files / augllm-2.5.0.tar.gz

Download URL augllm-2.5.0.tar.gz
Size 9.0 MB
Tags Source
SHA-256 checksum
How to use checksums
4fa765ec5379a8abe421d4025ab3fe8c8cc14ecf86e168de9b66fdece824a69c
BLAKE2b-256 checksum
How to use checksums
0c38d50adf4c0bab8a55224684828651353c0dd742113f82f0f96d679fde85f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.10

Release files / augllm-2.5.0-py3-none-any.whl

Download URL augllm-2.5.0-py3-none-any.whl
Size 48.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efbd8386d75524ac7c69311c852951e8220840c13455d17aafd3b90b46e97f4f
BLAKE2b-256 checksum
How to use checksums
9e55279c29d92f5390961e1f117b25e15439fb2970aad66ad50ce2f403825547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.10

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.3.5

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page