# Third-Party Licenses

`moon-gbnf` original MoonBit library source code, test harness code, CLI code, and documentation are licensed under the **Apache License, Version 2.0** (see [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE)).

Certain test files embed and/or adapt third-party GBNF grammar fixtures for compatibility testing. Those third-party grammar fixtures remain governed by their original **MIT License**, which coexists with the Apache-2.0 license of the original `moon-gbnf` code.

---

## `ggml-org/llama.cpp` GBNF Grammar Test Fixtures

- **Component**: `llama.cpp` GBNF grammar test fixtures (`json.gbnf`, `arithmetic.gbnf`, `list.gbnf`, `c.gbnf`, `chess.gbnf`, `english.gbnf`, `japanese.gbnf`, `json_arr.gbnf`)
- **Upstream Repository**: <https://github.com/ggml-org/llama.cpp> (`grammars/` directory)
- **License**: MIT License (full verbatim copy also distributed at [`licenses/LICENSE-llama.cpp-MIT.txt`](licenses/LICENSE-llama.cpp-MIT.txt))
- **Files in `moon-gbnf` embedding/adapting these fixtures**:
  - `compat_test.mbt` (`json.gbnf`, `arithmetic.gbnf`, `list.gbnf`, `c.gbnf`, `chess.gbnf`, `english.gbnf`, `japanese.gbnf`, `json_arr.gbnf`)
  - E2E test suite (`e2e/`, excluded from `mooncakes.io` package archive via `e2e/.moonignore`; inventory also maintained in [`e2e/fixtures/LICENSE_ATTRIBUTIONS.md`](e2e/fixtures/LICENSE_ATTRIBUTIONS.md)):
    - `e2e/fixtures/arithmetic.gbnf`
    - `e2e/fixtures/c.gbnf`
    - `e2e/fixtures/chess.gbnf`
    - `e2e/fixtures/english.gbnf`
    - `e2e/fixtures/japanese.gbnf`
    - `e2e/fixtures/json.gbnf`
    - `e2e/fixtures/json_arr.gbnf`
    - `e2e/fixtures/list.gbnf`
    - `e2e/fixtures/LICENSE_ATTRIBUTIONS.md`
    - `e2e/harness/fixtures.mbt`
    - `e2e/harness/harness_test.mbt`
    - `e2e/core/f5_llama_compat_test.mbt`
    - `e2e/scenarios/tier3_pairwise_test.mbt`
    - `e2e/scenarios/tier4_realworld_test.mbt`
    - `e2e/tests/scenarios_e2e.mjs`
- **Scope Note**: Only the embedded/adapted GBNF grammar text fixtures listed above originate from `ggml-org/llama.cpp` and are subject to the MIT License below. All MoonBit and JavaScript test harness code in `compat_test.mbt` and `e2e/` and all `moon-gbnf` library source code are original works licensed under the Apache License, Version 2.0 (`LICENSE` and `NOTICE`).

### Verbatim Upstream Copyright Notice and License Text (`llama.cpp`)

```text
MIT License

Copyright (c) 2023-2026 The ggml authors

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.
```
