|
31 | 31 | <li><a href="#worker-aware-async-scheduler">Schedule jobs</a></li> |
32 | 32 | <li><a href="#smtp-setup">Email Configuration</a></li> |
33 | 33 | <li><a href="#uv-knowledge-and-inspirations">UV knowledge and inspirations</a></li> |
| 34 | + <li><a href="#large-language-model">Integration with local LLM</a></li> |
34 | 35 | </ul> |
35 | 36 | </li> |
36 | 37 | <li><a href="#acknowledgments">Acknowledgments</a></li> |
@@ -162,6 +163,24 @@ This service supports plaintext and HTML emails, and also allows sending templat |
162 | 163 | It is implemented as a singleton to ensure that only one SMTP connection is maintained |
163 | 164 | throughout the application lifecycle, optimizing resource usage. |
164 | 165 |
|
| 166 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 167 | + |
| 168 | +### Large Language Model |
| 169 | +The `/v1/ml/chat/` endpoint is designed to handle chat-based interactions with the LLM model. |
| 170 | +It accepts a user prompt and streams responses back in real-time. |
| 171 | +The endpoint leverages FastAPI's asynchronous capabilities to efficiently manage multiple simultaneous requests, |
| 172 | +ensuring low latency and high throughput. |
| 173 | + |
| 174 | +FastAPI's async support is particularly beneficial for reducing I/O bottlenecks when connecting to the LLM model. |
| 175 | +By using asynchronous HTTP clients like `httpx`, |
| 176 | +the application can handle multiple I/O-bound tasks concurrently, |
| 177 | +such as sending requests to the LLM server and streaming responses back to the client. |
| 178 | +This approach minimizes idle time and optimizes resource utilization, making it ideal for high-performance applications. |
| 179 | + |
| 180 | +Install ollama and run the server |
| 181 | +```shell |
| 182 | +ollama run llama3.2 |
| 183 | +``` |
165 | 184 |
|
166 | 185 | <p align="right">(<a href="#readme-top">back to top</a>)</p> |
167 | 186 |
|
@@ -215,6 +234,7 @@ I've included a few of my favorites to kick things off! |
215 | 234 | - **[DEC 16 2024]** bump project to Python 3.13 :fast_forward: |
216 | 235 | - **[JAN 28 2025]** add SMTP setup :email: |
217 | 236 | - **[MAR 8 2025]** switch from poetry to uv :fast_forward: |
| 237 | +- **[MAY 3 2025]** add large language model integration :robot: |
218 | 238 |
|
219 | 239 | <p align="right">(<a href="#readme-top">back to top</a>)</p> |
220 | 240 |
|
|
0 commit comments