Xyro123 commited on
Commit
a61b7f1
·
verified ·
1 Parent(s): 56db801

Upload 7 files

Browse files
Files changed (7) hide show
  1. Dockerfile +18 -39
  2. chainlit.md +37 -0
  3. docker-compose.yaml +15 -0
  4. dockerignore +8 -0
  5. gitattributes +35 -0
  6. gitignore +179 -0
  7. requirements.txt +3 -7
Dockerfile CHANGED
@@ -1,50 +1,29 @@
1
- # Base image
2
- FROM python:3.11
3
 
 
4
  WORKDIR /app
5
 
6
- # Update pip
7
- RUN pip install --upgrade pip
8
-
9
- # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
11
- git \
12
- git-lfs \
13
- ffmpeg \
14
- libsm6 \
15
- libxext6 \
16
- cmake \
17
- rsync \
18
- libgl1 \
19
  curl \
20
- && rm -rf /var/lib/apt/lists/* \
21
- && git lfs install
22
-
23
- # Install Node.js 20.x
24
- RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
25
- apt-get install -y nodejs && \
26
- rm -rf /var/lib/apt/lists/*
27
-
28
- # Install fontsource-inter (Node.js package)
29
- RUN npm install fontsource-inter
30
-
31
- # Copy requirements.txt
32
- COPY requirements.txt /tmp/requirements.txt
33
-
34
- # Install Python dependencies
35
- RUN pip install --no-cache-dir -r /tmp/requirements.txt
36
 
37
- # Copy app code
38
- COPY ./ /app
 
 
39
 
40
- # Create symlink for convenience
41
- RUN mkdir -p /home/user && ( [ -e /home/user/app ] || ln -s /app/ /home/user/app ) || true
42
 
43
- # Set environment variable for Google API Key (override at runtime if needed)
44
- ENV GOOGLE_API_KEY="AIzaSyCMQ1C95v7GSyb5zjD5LJE146ikZur8Jfs"
 
45
 
46
- # Expose port (for Gradio or uvicorn)
47
  EXPOSE 7860
48
 
49
- # Default command
50
- CMD ["python", "app.py"]
 
1
+ # Use the official Python 3.12 image
2
+ FROM python:3.12-slim
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Install required system dependencies
 
 
 
8
  RUN apt-get update && apt-get install -y \
 
 
 
 
 
 
 
 
9
  curl \
10
+ git \
11
+ libpq-dev \
12
+ gcc \
13
+ && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ # Create the /app/files directory and set full permissions
16
+ RUN mkdir -p /app/.files && chmod 777 /app/.files
17
+ RUN mkdir -p /app/logs && chmod 777 /app/logs
18
+ RUN mkdir -p /app/observability_data && chmod 777 /app/observability_data
19
 
20
+ # Copy the current repository into the container
21
+ COPY . /app
22
 
23
+ # Upgrade pip and install dependencies
24
+ RUN pip install --upgrade pip && \
25
+ pip install -r requirements.txt
26
 
 
27
  EXPOSE 7860
28
 
29
+ CMD python -m chainlit run app/app.py -w --host 0.0.0.0 --port 7860
 
chainlit.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to Reasoner4All! 🚀🤖
2
+
3
+ Reasoner4All is a simple demo that allows you to supercharge your favorite LLMs by integrating advanced reasoning capabilities from the latest open-source thinking models. Whether you're working with OpenAI, Mistral, Groq, or Gemini, this framework seamlessly enhances their decision-making with an additional reasoning layer. Leverage models like DeepSeek R1 Distill LLaMA-70B to improve your AI's problem-solving skills and contextual understanding!
4
+
5
+ ## Useful Links 🔗
6
+
7
+ - AiCore [Repo](https://github.com/BrunoV21/AiCore) my custom wrapper around multiple providers which uniforms streaming, json outputs and reasoning integration.
8
+
9
+ ## Features
10
+
11
+ **Supports Multiple LLM Providers**
12
+ - OpenAI
13
+ - Mistral
14
+ - Groq (including DeepSeek R1 Distill LLaMA-70B for reasoning)
15
+ - Gemini
16
+ - and more!
17
+
18
+ **Reasoner Integration**
19
+ - Uses an additional (reasoning) LLM to enhance reasoning capabilities
20
+ - Support for Deepseek R1 Distill LLaMA-70B (Groq Hosted) and Deepseek R1 (Nvidia Hosted)
21
+
22
+ **Conversation History**
23
+ - For context reasons the converstation history up to latest 4096 tokens is preserved and passed to the llms as context
24
+
25
+ ## User Interface
26
+ **Settings**
27
+ - Provider and Model selection
28
+ - Reasoner Option and Model selection
29
+ - Support for System Propmpt and Reasoner System prompt specification
30
+
31
+ **Profiles**
32
+ - Reasoner4All uses a series of pre-set API Keys for demo purposes
33
+ - OpenAi allows you to connect to your models with support for api key if required *don't worry I am not logging your keys anwyehre but you can check the src code of this space to be sure :)*
34
+
35
+ **Chat**
36
+ - Reasoning steps appear inside a step which can be expanded to visualize the process
37
+
docker-compose.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3.8"
2
+
3
+ services:
4
+ app:
5
+ build:
6
+ context: .
7
+ dockerfile: Dockerfile
8
+ env_file:
9
+ - .env
10
+ ports:
11
+ - "7860:7860"
12
+ volumes:
13
+ - .:/app
14
+ restart: unless-stopped
15
+ command: python -m chainlit run app/app.py -w --host 0.0.0.0 --port 7860
dockerignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ .env
2
+ .logs
3
+ config.yml
4
+ config.yaml
5
+ Dockerfile
6
+ .dockerignore
7
+
8
+ config/config.yml
gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
gitignore ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # PyPI configuration file
171
+ .pypirc
172
+
173
+ config/config.yml
174
+
175
+ public/
176
+
177
+ */storage/
178
+
179
+ logs/
requirements.txt CHANGED
@@ -1,7 +1,3 @@
1
- gradio==5.42.0
2
- fastapi
3
- openai
4
- requests
5
- markdown
6
- uvicorn
7
- google-generativeai
 
1
+ core-for-ai @ git+https://github.com/BrunoV21/AiCore.git#egg=core-for-ai[all]
2
+ chainlit==2.1.0
3
+ # pymupdf4llm==0.0.17