···11+# MIT License
22+33+# Copyright (c) 2025 The BROKE team 🦫
44+55+# Permission is hereby granted, free of charge, to any person obtaining a copy
66+# of this software and associated documentation files (the "Software"), to deal
77+# in the Software without restriction, including without limitation the rights
88+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99+# copies of the Software, and to permit persons to whom the Software is
1010+# furnished to do so, subject to the following conditions:
1111+1212+# The above copyright notice and this permission notice shall be included in all
1313+# copies or substantial portions of the Software.
1414+1515+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121+# SOFTWARE.
2222+123from fastapi import FastAPI, HTTPException
224from .config import SYSTEM_PROMPT
325
+20-1
server/cache_utils.py
···11-# mlx_knife/cache_utils.py
11+# MIT License
22+33+# Copyright (c) 2025 The BROKE team 🦫
44+55+# Permission is hereby granted, free of charge, to any person obtaining a copy
66+# of this software and associated documentation files (the "Software"), to deal
77+# in the Software without restriction, including without limitation the rights
88+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99+# copies of the Software, and to permit persons to whom the Software is
1010+# furnished to do so, subject to the following conditions:
1111+1212+# The above copyright notice and this permission notice shall be included in all
1313+# copies or substantial portions of the Software.
2141515+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121+# SOFTWARE.
322import datetime
423import json
524import os
+20
server/model_card.py
···11+# MIT License
1233+# Copyright (c) 2025 The BROKE team 🦫
44+55+# Permission is hereby granted, free of charge, to any person obtaining a copy
66+# of this software and associated documentation files (the "Software"), to deal
77+# in the Software without restriction, including without limitation the rights
88+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99+# copies of the Software, and to permit persons to whom the Software is
1010+# furnished to do so, subject to the following conditions:
1111+1212+# The above copyright notice and this permission notice shall be included in all
1313+# copies or substantial portions of the Software.
1414+1515+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121+# SOFTWARE.
222from __future__ import annotations
323424# ruff: noqa: UP045
+21
server/reasoning_utils.py
···11+# MIT License
22+33+# Copyright (c) 2025 The BROKE team 🦫
44+55+# Permission is hereby granted, free of charge, to any person obtaining a copy
66+# of this software and associated documentation files (the "Software"), to deal
77+# in the Software without restriction, including without limitation the rights
88+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99+# copies of the Software, and to permit persons to whom the Software is
1010+# furnished to do so, subject to the following conditions:
1111+1212+# The above copyright notice and this permission notice shall be included in all
1313+# copies or substantial portions of the Software.
1414+1515+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121+# SOFTWARE.
122"""
223Utilities for handling reasoning models and their output.
324