llmapi server
1.0.0
Serveur d'auto-hôte LLMAPI
中文文档
LLMAPI-Server est un backend abstrait qui résume une variété de modèles de grande langue (LLM, tels que Chatgpt, GPT-3, GPT-4, etc.), et fournit des services d'accès simples via OpenAPI
? Si cela vous est utile, veuillez le jouer?
graphique LR
Server Sub-Graph LLMAPI
OpenAPI -> Session
OpenAPI -> pre_post
backend subgraph
Remplissage backend de style: # F9f
pre_post -> chatppt
pre_post -> dall-e
pre_post -> lama
pre_post -> ...
fin
fin
Texte -> OpenAPI
Image -> OpenAPI
Incorporer -> OpenAPI
Autres -> OpenAPI
chatgpt : interface officielle d'Openai Chatgpt gpt3 : Interface officielle d'Openai GPT-3 gpt-embedding : Interface d'intégration officielle d'Openai dall-e : Interface officielle d'Openai · E welm : l'interface LLM de WeChat newbing : NOUVEAU BING BASE BASE SUR CHATGPT (OFFICIAL) # python >= 3.8
python3 -m pip install -r requirements.txt
python3 run_api_server.py./build_docker.sh
./start_docker.shcurl pour accéder: # 1. Start a new session
curl -X POST -H " Content-Type: application/json " -d ' {"bot_type":"mock"} ' http://127.0.0.1:5050/v1/chat/start
# response sample: {"code":0,"msg":"Success","session":"123456"}
# 2. chat with LLMs
curl -X POST -H " Content-Type: application/json " -d ' {"session":"123456","content":"hello"} ' http://127.0.0.1:5050/v1/chat/ask
# response sample: {"code":0,"msg":"Success","reply":"Text mock reply for your prompt:hello","timestamp":1678865301.0842562}
# 3. Close the session and end chat
curl -X POST -H " Content-Type: application/json " -d ' {"session":"123456"} ' http://127.0.0.1:5050/v1/chat/end
# response: {"code":0,"msg":"Success"}llmapi_cli --host= " http://127.0.0.1:5050 " --bot=mock from llmapi_cli import LLMClient
client = LLMClient ( host = "http://127.0.0.1:5050" , bot = "mock" )
rep = client . ask ( "hello" )
print ( rep )newllm ), vous pouvez directement cp -r mock newllmmock , modifiez le nom backend en newllmnewllm , ajoutez les dépendances nécessaires, et tout le développement connexe est lié à ce répertoirenewllm dans backend.py