Helper function to check if an endpoint requires NPU access
| 158 | |
| 159 | // Helper function to check if an endpoint requires NPU access |
| 160 | bool requires_npu_access(const std::string& method, const std::string& path) { |
| 161 | // NPU-intensive endpoints that should be restricted to one user at a time |
| 162 | if (method == "POST") { |
| 163 | return path == "/api/generate" || |
| 164 | path == "/api/chat" || |
| 165 | path == "/v1/chat/completions" || |
| 166 | path == "/v1/audio/transcriptions" || |
| 167 | path == "/v1/embeddings"; |
| 168 | } |
| 169 | return false; |
| 170 | } |
| 171 | |
| 172 | ///@brief HttpSession class implementation |
| 173 | ///@param socket the socket |