psylink
1.0.0
로컬 LLM 프롬프트를 배포하기위한 백엔드 및 최소한의 프로토콜. Python 및 Redis 용 Llama CPP를 사용하여 제작되었습니다.
┌────────┐ ┌────────────────┐
│ 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
필요한 파이썬 패키지를 설치하려면
클라이언트 입력 큐 메시지 형식 :
{
"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