MB Story

MB Story | coder

0%

llm部署:llama.app


llama.app

  • 仓库
  • 支持http server部署
  • 支持一键启动
  • 丰富的启动参数
  • 支持CPU和GPU运行

安装

1
server.exe -m models\7B\ggml-model.gguf -c 2048 -ngl 50 --host 10.168.166.90 --port 8777
  • 常用参数
    • -ngl
      -ngl后面需要加整数参数,表示多少层offload到GPU(比如-ngl 30表示把30层参数offload到GPU)。这个值需要自己试探,比如加到多少层不OOM。llama.cpp会有log,关注VRAM使用情况,例如:
      1
      2
      llama_model_load_internal: [cublas] offloading 30 layers to GPU
      llama_model_load_internal: [cublas] total VRAM used: 10047 MB

http url test

完整URL参数

GET

  • /health: 返回服务器当前状态

POST

  • /completion: 发送提示词prompt, 返回预测结果.

  • 示例

    1
    2
    3
    4
    curl --request POST \
    --url http://localhost:8080/completion \
    --header "Content-Type: application/json" \
    --data '{"prompt": "Building a website can be done in 10 simple steps:","n_predict": 128}'