langchain-chatchat+xinference 部署记录

为什么就是接不上llm接口呢 无语了

记得暴露api,ui,xinference的端口
在这里插入图片描述

启动xinference

pip install “xinference[all]”// 下不下来 光下了vllm
pip install “xinference[vllm]”

就得用modelscope 要不然用huggingface下不下来模型
运行:
XINFERENCE_MODEL_SRC=modelscope xinference-local --host 0.0.0.0 --port 9997
进入页面
在这里插入图片描述
先下embedding再下llm,下载用modelscope
qwen2.5-7b约占用25.44GB显存
在这里插入图片描述

弱智了 这个得下qwen2.5instruct才能问答

在这里插入图片描述

chatchat

chatchat init
修改model_settings.yaml 改llm和embedding
看好是large还是base
在这里插入图片描述
在这里插入图片描述

验证
chatchat kb -r
启动
chatchat start -a
接口端api:
在这里插入图片描述

ui端
在这里插入图片描述
知识库部分
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

配置文件备份

我就纳闷了为甚么非得走那个模型加载平台呢
那个模型加载平台还不让走我的接口
model_settings.yaml

# 模型配置项


# 默认选用的 LLM 名称
DEFAULT_LLM_MODEL: qwen2.5

# 默认选用的 Embedding 名称
DEFAULT_EMBEDDING_MODEL: bge-large-zh-v1.5
# DEFAULT_EMBEDDING_MODEL: quentinz/bge-large-zh-v1.5

# AgentLM模型的名称 (可以不指定,指定之后就锁定进入Agent之后的Chain的模型,不指定就是 DEFAULT_LLM_MODEL)
Agent_MODEL: ''

# 默认历史对话轮数
HISTORY_LEN: 3

# 大模型最长支持的长度,如果不填写,则使用模型默认的最大长度,如果填写,则为用户设定的最大长度
MAX_TOKENS:

# LLM通用对话参数
TEMPERATURE: 0.7

# 支持的Agent模型
SUPPORT_AGENT_MODELS:
  - chatglm3-6b
  - glm-4
  - openai-api
  - Qwen-2
  - qwen2-instruct
  - gpt-3.5-turbo
  - gpt-4o

# LLM模型配置,包括了不同模态初始化参数。
# `model` 如果留空则自动使用 DEFAULT_LLM_MODEL
LLM_MODEL_CONFIG:
  preprocess_model:
    model: ''
    temperature: 0.05
    max_tokens: 4096
    history_len: 10
    prompt_name: default
    callbacks: false
  llm_model:
    model: ''
    temperature: 0.9
    max_tokens: 4096
    history_len: 10
    prompt_name: default
    callbacks: true
  action_model:
    model: ''
    temperature: 0.01
    max_tokens: 4096
    history_len: 10
    prompt_name: ChatGLM3
    callbacks: true
  postprocess_model:
    model: ''
    temperature: 0.01
    max_tokens: 4096
    history_len: 10
    prompt_name: default
    callbacks: true
  image_model:
    model: sd-turbo
    size: 256*256

# # 模型加载平台配置


# # 平台名称
# platform_name: xinference

# # 平台类型
# # 可选值:['xinference', 'ollama', 'oneapi', 'fastchat', 'openai', 'custom openai']
# platform_type: xinference

# # openai api url
# api_base_url: http://127.0.0.1:9997/v1

# # api key if available
# api_key: EMPTY

# # API 代理
# api_proxy: ''

# # 该平台单模型最大并发数
# api_concurrencies: 5

# # 是否自动获取平台可用模型列表。设为 True 时下方不同模型类型可自动检测
# auto_detect_model: false

# # 该平台支持的大语言模型列表,auto_detect_model 设为 True 时自动检测
# llm_models: []

# # 该平台支持的嵌入模型列表,auto_detect_model 设为 True 时自动检测
# embed_models: []

# # 该平台支持的图像生成模型列表,auto_detect_model 设为 True 时自动检测
# text2image_models: []

# # 该平台支持的多模态模型列表,auto_detect_model 设为 True 时自动检测
# image2text_models: []

# # 该平台支持的重排模型列表,auto_detect_model 设为 True 时自动检测
# rerank_models: []

# # 该平台支持的 STT 模型列表,auto_detect_model 设为 True 时自动检测
# speech2text_models: []

# # 该平台支持的 TTS 模型列表,auto_detect_model 设为 True 时自动检测
# text2speech_models: []
MODEL_PLATFORMS:
  - platform_name: xinference
    platform_type: xinference
    api_base_url: http://127.0.0.1:9997/v1
    api_key: EMPTY
    api_proxy: ''
    api_concurrencies: 5
    auto_detect_model: false
    llm_models:
      - qwen2.5
    embed_models:
      - bge-large-zh-v1.5
    text2image_models: []
    image2text_models: []
    rerank_models: []
    speech2text_models: []
    text2speech_models: []

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值