File size: 1,586 Bytes
d8328bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: '3.8'

services:
  model-server:
    build:
      context: .
      dockerfile: Dockerfile
    image: nexasci-agent:latest
    container_name: nexasci-model-server
    command: uvicorn agent.model_server:app --host 0.0.0.0 --port 8001
    ports:
      - "8001:8001"
    volumes:
      - ./models:/app/models
      - ./agent:/app/agent
      - ~/.cache/huggingface:/root/.cache/huggingface
    environment:
      - CUDA_VISIBLE_DEVICES=0
      - TOKENIZERS_PARALLELISM=false
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    restart: unless-stopped

  tool-server:
    build:
      context: .
      dockerfile: Dockerfile
    image: nexasci-agent:latest
    container_name: nexasci-tool-server
    command: uvicorn tools.server:app --host 0.0.0.0 --port 8000
    ports:
      - "8000:8000"
    volumes:
      - ./tools:/app/tools
      - ./pipeline:/app/pipeline
      - ./index:/app/index
      - ./tmp:/app/tmp
    environment:
      - TOKENIZERS_PARALLELISM=false
    restart: unless-stopped
    depends_on:
      - model-server

  agent:
    build:
      context: .
      dockerfile: Dockerfile
    image: nexasci-agent:latest
    container_name: nexasci-agent
    command: python examples/demo_agent.py --prompt "Hello, test the agent system."
    volumes:
      - ./examples:/app/examples
      - ./agent:/app/agent
    environment:
      - TOKENIZERS_PARALLELISM=false
    depends_on:
      - model-server
      - tool-server
    stdin_open: true
    tty: true