mlx-lm - https://github.com/ml-explore/mlx-lm

gmlx carries mlx-lm 0.31.3 whole under gmlx/_vendor/mlx_lm, with only its
imports rewritten and a few marked edits (gmlx/_vendor/manifest.json lists
every file). The modules below carry further code copied or ported from
mlx-lm, with modifications.

gmlx vendors model/cache classes from unmerged mlx-lm pull requests, with
modifications: gmlx/models/deepseek_v4/model.py and
gmlx/models/deepseek_v4/hyper_connection.py from PR #1192 (DeepSeek V4 Flash),
gmlx/models/minimax_m3.py from PR #1401 (MiniMax M3),
gmlx/models/hy_v3/model.py from PR #1485 (Tencent Hy3), and
gmlx/models/deepseek_v4/cache.py (DS4PoolingCache/DS4BatchPoolingCache) from
PR #1192.
gmlx/models/function_gemma.py carries the FunctionGemma tool parser of mlx-lm
0.31.3 (mlx_lm/tool_parsers/function_gemma.py), by way of mlx-vlm 0.6.15,
which shipped it as mlx_vlm/tool_parsers/function_gemma.py.
gmlx/cache/kv_cache.py and gmlx/cache/attention.py carry the KV cache
classes of mlx_lm/models/cache.py and the mask and SDPA helpers of
mlx_lm/models/base.py, by way of mlx-vlm 0.7.3, which copied them into
mlx_vlm/models/cache.py and mlx_vlm/models/base.py. The copy's
mlx_lm/models/cache.py and mlx_lm/models/base.py import them from there.
gmlx/models/kimi_k3.py is built on the kimi_linear model of mlx-lm 0.31.3
(mlx_lm/models/kimi_linear.py), and its ShortConv1d follows that module's.

mlx-lm is distributed under the MIT License:

MIT License

Copyright © 2023 Apple Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
