├── .gitignore ├── .gitmodules ├── LICENSE ├── Package.resolved ├── Package.swift ├── README.md ├── Sources ├── CMLXStructured │ ├── error_handler.cpp │ ├── grammar_compiler.cpp │ ├── grammar_matcher.cpp │ ├── include │ │ ├── mlx_structured.h │ │ ├── mlx_structured │ │ │ ├── error_handler.h │ │ │ ├── grammar_compiler.h │ │ │ ├── grammar_matcher.h │ │ │ └── tokenizer_info.h │ │ └── module.modulemap │ └── tokenizer_info.cpp ├── MLXStructured │ ├── Backends │ │ ├── DLTensor.swift │ │ └── XGrammar.swift │ ├── Generate.swift │ ├── Grammar │ │ ├── Grammar+Encoding.swift │ │ ├── Grammar+Generable.swift │ │ ├── Grammar+Schema.swift │ │ ├── Grammar+Structural.swift │ │ └── Grammar.swift │ ├── GrammarMaskedLogitProcessor.swift │ ├── GrammarMatcher.swift │ ├── GrammarMatcherFactory.swift │ └── Structural │ │ ├── StructuralTag+Builder.swift │ │ └── StructuralTag.swift └── MLXStructuredCLI │ ├── Commands │ ├── CodableExample.swift │ ├── GenerableExample.swift │ ├── StructuralExample.swift │ └── ToolCallingExample.swift │ └── RootCommand.swift └── Tests └── MLXStructuredTests ├── TestErrorHandler.swift ├── TestGenerablePerformance.swift ├── TestGrammarMatcher.swift ├── TestMemoryLeaks.swift └── TestPerformance.swift /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/.gitignore -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/.gitmodules -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/LICENSE -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Package.resolved -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Package.swift -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/README.md -------------------------------------------------------------------------------- /Sources/CMLXStructured/error_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/error_handler.cpp -------------------------------------------------------------------------------- /Sources/CMLXStructured/grammar_compiler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/grammar_compiler.cpp -------------------------------------------------------------------------------- /Sources/CMLXStructured/grammar_matcher.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/grammar_matcher.cpp -------------------------------------------------------------------------------- /Sources/CMLXStructured/include/mlx_structured.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/include/mlx_structured.h -------------------------------------------------------------------------------- /Sources/CMLXStructured/include/mlx_structured/error_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/include/mlx_structured/error_handler.h -------------------------------------------------------------------------------- /Sources/CMLXStructured/include/mlx_structured/grammar_compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/include/mlx_structured/grammar_compiler.h -------------------------------------------------------------------------------- /Sources/CMLXStructured/include/mlx_structured/grammar_matcher.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/include/mlx_structured/grammar_matcher.h -------------------------------------------------------------------------------- /Sources/CMLXStructured/include/mlx_structured/tokenizer_info.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/include/mlx_structured/tokenizer_info.h -------------------------------------------------------------------------------- /Sources/CMLXStructured/include/module.modulemap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/include/module.modulemap -------------------------------------------------------------------------------- /Sources/CMLXStructured/tokenizer_info.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/CMLXStructured/tokenizer_info.cpp -------------------------------------------------------------------------------- /Sources/MLXStructured/Backends/DLTensor.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Backends/DLTensor.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Backends/XGrammar.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Backends/XGrammar.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Generate.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Generate.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Grammar/Grammar+Encoding.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Grammar/Grammar+Encoding.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Grammar/Grammar+Generable.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Grammar/Grammar+Generable.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Grammar/Grammar+Schema.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Grammar/Grammar+Schema.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Grammar/Grammar+Structural.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Grammar/Grammar+Structural.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Grammar/Grammar.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Grammar/Grammar.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/GrammarMaskedLogitProcessor.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/GrammarMaskedLogitProcessor.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/GrammarMatcher.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/GrammarMatcher.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/GrammarMatcherFactory.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/GrammarMatcherFactory.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Structural/StructuralTag+Builder.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Structural/StructuralTag+Builder.swift -------------------------------------------------------------------------------- /Sources/MLXStructured/Structural/StructuralTag.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructured/Structural/StructuralTag.swift -------------------------------------------------------------------------------- /Sources/MLXStructuredCLI/Commands/CodableExample.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructuredCLI/Commands/CodableExample.swift -------------------------------------------------------------------------------- /Sources/MLXStructuredCLI/Commands/GenerableExample.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructuredCLI/Commands/GenerableExample.swift -------------------------------------------------------------------------------- /Sources/MLXStructuredCLI/Commands/StructuralExample.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructuredCLI/Commands/StructuralExample.swift -------------------------------------------------------------------------------- /Sources/MLXStructuredCLI/Commands/ToolCallingExample.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructuredCLI/Commands/ToolCallingExample.swift -------------------------------------------------------------------------------- /Sources/MLXStructuredCLI/RootCommand.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Sources/MLXStructuredCLI/RootCommand.swift -------------------------------------------------------------------------------- /Tests/MLXStructuredTests/TestErrorHandler.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Tests/MLXStructuredTests/TestErrorHandler.swift -------------------------------------------------------------------------------- /Tests/MLXStructuredTests/TestGenerablePerformance.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Tests/MLXStructuredTests/TestGenerablePerformance.swift -------------------------------------------------------------------------------- /Tests/MLXStructuredTests/TestGrammarMatcher.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Tests/MLXStructuredTests/TestGrammarMatcher.swift -------------------------------------------------------------------------------- /Tests/MLXStructuredTests/TestMemoryLeaks.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Tests/MLXStructuredTests/TestMemoryLeaks.swift -------------------------------------------------------------------------------- /Tests/MLXStructuredTests/TestPerformance.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petrukha-ivan/mlx-swift-structured/HEAD/Tests/MLXStructuredTests/TestPerformance.swift --------------------------------------------------------------------------------