psylink
1.0.0
ローカルLLMプロンプトを配布するためのバックエンドと最小プロトコル。 Python用のLlama CPPを使用して構築され、Redis。
┌────────┐ ┌────────────────┐
│ Client ├──────┐ ┌─────┤ Psylink Worker │
└────────┘ │ ┌──────────────────────────────┐ │ └────────────────┘
└──┤ ├──┘
┌────────┐ │ Redis Message Broker Server │ ┌────────────────┐
│ Client ├─────────┤ ├────────┤ Psylink Worker │
└────────┘ ├──────────────────────────────┤ └────────────────┘
│ │
┌────────┐ │ Prompt Input/ Output Queues │ ┌────────────────┐
│ Client ├─────────┤ ├────────┤ Psylink Worker │
└────────┘ │ Command Input/ Output Queues │ └────────────────┘
┌───┤ ├──┐
┌────────┐ │ └──────────────────────────────┘ │ ┌────────────────┐
│ Client ├─────┘ └─────┤ Psylink Worker │
└────────┘ └────────────────┘
仮想環境を作成して実行します
pip install -r requirements.txt
必要なPythonパッケージをインストールします。
クライアント入力キューメッセージフォーマット:
{
"message_id" : str ,
"client_id" : str ,
"priority" : int ,
"input" : str ,
"timestamp" : int
}クライアントコマンドキューメッセージフォーマット:
{
"message_id" : str ,
"client_id" : str ,
"worker_id" : str ,
"input" : {
"command" : str ,
"args" : dict | None
},
"timestamp" : int
}ワーカー出力キューメッセージフォーマット:
{
"message_id" : str ,
"client_id" : str ,
"worker_id" : str ,
"input" : str ,
"output" : str ,
"timestamp" : int
}例config.toml:
[ redis ]
host = " localhost "
port = 6379
password = " supersecretpassword "
db = 0
prompt_input_queue = " psy_prompt_input_queue "
prompt_output_queue = " psy_prompt_output_queue "
command_input_queue = " psy_command_input_queue "
command_output_queue = " psy_command_output_queue "
[ model ]
model_path = " models/codellama-13b-instruct.Q8_0.gguf "
[ llama_params ]
max_tokens = 32
echo = true
temperature = 0.85
[ properties ]
min_priority = 1
max_priority = 5