Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【错误】添加本地ollama模型无法连接 #78

Open
milesxia opened this issue Nov 5, 2024 · 2 comments
Open

【错误】添加本地ollama模型无法连接 #78

milesxia opened this issue Nov 5, 2024 · 2 comments
Labels
【错误/BUG】 出现了某种错误

Comments

@milesxia
Copy link

milesxia commented Nov 5, 2024

操作系统

docker compose

项目版本

V0.9.0

Python版本

No response

错误描述

ollama api端口连接,同样地址使用dify测试能够连接,chenyme-aavt无法连接,提示 测试失败:Connection error.
并且在容器日志内没有任何内容,无法锁定问题

重现步骤

version: '3'

networks:
  chenyme-aavt:
    driver: bridge

services:
  chenyme-aavt:
    container_name: chenyme-aavt
    image: chenyme/chenyme-aavt:latest
    restart: unless-stopped
    networks:
      - chenyme-aavt
    ports:
      - "8501:8501"        # Web GUI
    volumes:
      - '/share/CACHEDEV1_DATA/Container/chenymeaavt/conf:/app/project/config'
      - '/share/CACHEDEV1_DATA/Container/chenymeaavt/model:/app/model'
      - '/share/CACHEDEV1_DATA/Container/chenymeaavt/output:/app/project/cache'
    devices:
      - /dev/dri:/dev/dri  # 使用 GPU,如果不需要则删除
    environment:
      - PUID=1000          # 用户 ID
      - PGID=1000          # 用户组 ID
      - OLLAMA_API_URL=http://192.168.200.110:11434  # 将ollama服务地址指向容器名

  ollama:
    image: ollama/ollama:latest
    container_name: ollama_server
    restart: unless-stopped
    networks:
      - chenyme-aavt       # 将ollama服务加入到同一网络
    environment:
      OLLAMA_HOST: 0.0.0.0                # 设置为监听所有IP地址
      OLLAMA_KEEP_ALIVE: -1               # 保持连接持续时间,-1表示不限制
      OLLAMA_MAX_LOADED_MODELS: 5         # 设置最多加载的模型数量
      OLLAMA_PORT: 11434                  # 模型服务端口
      OLLAMA_NUM_PARALLEL: 5              # 并行处理数量
    ports:
      - 11434:11434                       # 将主机端口映射到容器内部端口
    volumes:
      - /share/Container/ollama:/root/.ollama   # 将本地模型目录挂载到容器内

错误截图

No response

其他信息(可选)

No response

@milesxia milesxia added the 【错误/BUG】 出现了某种错误 label Nov 5, 2024
@iridiumgithub
Copy link

url:http://127.0.0.1:11434/v1
密码写ollama试试

@milesxia
Copy link
Author

尝试了并没有效果,关键只显示连接失败,没有其他更进一步信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
【错误/BUG】 出现了某种错误
Projects
None yet
Development

No branches or pull requests

2 participants