ローカルLLM(mlx / mlx-vlm / llama.cpp / router)を OpenAI 互換 API として起動・管理する軽量サーバー
Project description
local-llm-server
ローカルLLM(mlx / mlx-vlm / llama.cpp)を OpenAI 互換 API として 起動・管理する軽量サーバー。テキストと画像(vision)を自動で振り分ける router モードを備え、任意の OpenAI 互換クライアントからそのまま利用できる。
- コア機能(プロセスの起動・監視・graceful shutdown・router プロキシ)は 標準ライブラリのみで動作。
- 実際の推論バックエンドは extras で導入(Apple Silicon では
mlxを自動選択)。
インストール
pip install local-llm-server # コア(バックエンドは別途用意)
pip install "local-llm-server[mlx]" # Apple Silicon 向け mlx / mlx-vlm 同梱
使い方
# テキストLLMを起動(既定バックエンドは環境に応じて自動選択)
local-llm-server --backend mlx
# 画像入力対応(vision)
local-llm-server --backend mlx-vlm
# テキストLLMとVLMを同時起動し、リクエスト内容で自動振り分け
local-llm-server --backend router
起動後、表示される base_url(例 http://127.0.0.1:8080/v1)を
OpenAI 互換クライアントに設定する。
import local_llm_server as srv
config = srv.ServerConfig(model="mlx-community/Qwen3.6-27B-4bit", backend="mlx")
with srv.LocalServer(config) as server:
server.wait_until_ready()
print(srv.list_models(server.base_url))
ライセンス
Apache-2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
local_llm_server-0.1.0.tar.gz
(25.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file local_llm_server-0.1.0.tar.gz.
File metadata
- Download URL: local_llm_server-0.1.0.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e81e9144399350b44eeaf946ef9066010f5e6efe22657404f0d5b8ac4e7dbb8b
|
|
| MD5 |
3507016ef16d320dc8aba2f1fb7b153e
|
|
| BLAKE2b-256 |
057db1dff479d2a46fd15a84bb783d742eaf5d3e3f2621d2e92b03f7e1afe983
|
File details
Details for the file local_llm_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: local_llm_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d98abf265e849888ba4a1d784313789211c9c1e1b0ea68ca22a99ee82952998b
|
|
| MD5 |
1dac71b569a2f10aff850f73d55845f3
|
|
| BLAKE2b-256 |
c523ebb3112addb8a36f878f7799d7a8dc72514fbe55fcd6aa6709c46d74f9e4
|