File size: 1,525 Bytes
c33a7ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
- name: Test Environment Provisioning
  hosts: test_environments
  remote_user: fedora
  become: true
  gather_facts: false

  tasks:

  - name: Wait until the instance is ready
    ansible.builtin.wait_for_connection:
    delay: 10
    timeout: 60

  - name: Gather facts for first time
    ansible.builtin.setup:

  - name: Required Packages
    ansible.builtin.package:
      name: "{{ item }}"
      state: present
    with_items:
    - podman
    - python3-libdnf5

  - name: Models host directory
    ansible.builtin.file:
      path: locallm/models
      state: directory

  - name: Download Model
    ansible.builtin.get_url:
      url: https://huggingface.co/MaziyarPanahi/Mistral-7B-Instruct-v0.3-GGUF/resolve/main/Mistral-7B-Instruct-v0.3.Q4_K_M.gguf
      dest: locallm/models

  - name: Run Model
    containers.podman.podman_container:
      name: llamacpp_python
      image: ghcr.io/containers/llamacpp_python:latest
      state: started
      interactive: true
      tty: true
      detach: true
      ports:
      - 8001:8001
      volume:
      - ./locallm/models:/locallm/models:ro,Z
      env:
        MODEL_PATH: models/Mistral-7B-Instruct-v0.3.Q4_K_M.gguf
        HOST: 0.0.0.0
        PORT: 8001

  - name: Run Application
    containers.podman.podman_container:
      name: function_calling
      image: ghcr.io/containers/function_calling:latest
      state: started
      interactive: true
      tty: true
      ports:
      - 8501:8501
      env:
        MODEL_ENDPOINT: http://10.88.0.1:8001