docs / Inicio rápidoQuickstart
Inicio rápido#
Construye una vez el toolkit de tu dominio. Después, coloca su prompt en tu flujo de IA y convierte cada respuesta .mini de vuelta al JSON que consume tu aplicación.
1. Instalar#
Descargar toolkit 1.1.0 (.zip) · Paquete Python (.whl) · Código fuente (.zip)
Requiere Python 3.9 o posterior. El núcleo y el toolkit generado usan la biblioteca estándar.
pip install https://mini-format.pmoluna.com/downloads/mini_format-1.1.0-py3-none-any.whl
mini --help
Para instalar sin conexión, descarga el ZIP, extráelo y ejecuta pip install sobre el archivo .whl incluido. Con Node 22.6 o posterior, instala el paquete del perfil base: npm install ./mini-format-core-1.1.0.tgz. Puedes descargarlo por separado. El toolkit de dominio generado es Python; las bibliotecas TypeScript y JavaScript implementan el perfil base.
2. Reunir ejemplos de tu JSON#
Guarda esto como phones.json:
[
{"id": 1, "brand": "Acme", "model": "One", "price": 299, "available": true},
{"id": 2, "brand": "Acme", "model": "Pro", "price": 499, "available": false}
]
Incluye en archivos adicionales ejemplos de campos opcionales, listas, objetos anidados y valores nulos. La diversidad de casos importa más que repetir la misma muestra.
3. Crear tu .mini#
mini build phones.json --prefix phone --out .mini
Para combinar muestras: mini build phones.json more-phones.json --prefix phone --out .mini.
La carpeta .mini contiene el contrato, el esquema JSON, prompts en ambos idiomas, parser, validador, reparación, ejemplos y manifiesto. Lee Crear tu toolkit para conocer el perfil generado y sus reglas.
4. Integrar#
Usa .mini/prompt.es.md como instrucción de formato para tu modelo. Guarda su respuesta en response.mini.
python .mini/validator.py response.mini
python .mini/parser.py decode response.mini
El segundo comando imprime el JSON reconstruido. También puedes usar loads(texto) y dumps(objeto) al importar el módulo generado parser.py desde tu aplicación.
5. Detectar y reparar#
python .mini/parser.py diagnose response.mini
python .mini/repair.py response.mini --out corrected.mini
La reparación normaliza envoltorios y saltos de línea seguros. Nunca inventa valores que faltan. Cambiar el recuento declarado exige --fix-count; úsalo solo si has comprobado que el lote recibido está completo. Los errores semánticos necesitan una corrección de tu aplicación o un reintento del modelo.
Familias incorporadas#
Las 14 familias del perfil base siguen disponibles: mini forks, mini prompt log --lang es y mini validate documento.mini. Sus APIs están en Python, TypeScript y CLI.
El playground permite explorar el perfil base y comparar formatos sin instalar nada.
Quickstart#
Build your domain toolkit once. Then add its prompt to your AI workflow and convert each .mini response back into the JSON your application consumes.
1. Install#
Download toolkit 1.1.0 (.zip) · Python package (.whl) · Source code (.zip)
Requires Python 3.9 or later. The core and generated toolkit use the standard library.
pip install https://mini-format.pmoluna.com/downloads/mini_format-1.1.0-py3-none-any.whl
mini --help
To install offline, download and extract the ZIP, then run pip install on the included .whl file. With Node 22.6 or later, install the base-profile package: npm install ./mini-format-core-1.1.0.tgz. You can also download it separately. The generated domain toolkit is Python; the TypeScript and JavaScript libraries implement the base profile.
2. Gather JSON examples#
Save this as phones.json:
[
{"id": 1, "brand": "Acme", "model": "One", "price": 299, "available": true},
{"id": 2, "brand": "Acme", "model": "Pro", "price": 499, "available": false}
]
Add examples of optional fields, lists, nested objects and null values in additional files. Diverse cases matter more than repeating the same sample.
3. Build your .mini#
mini build phones.json --prefix phone --out .mini
To combine samples: mini build phones.json more-phones.json --prefix phone --out .mini.
The .mini directory contains the contract, JSON schema, prompts in both languages, parser, validator, repair tools, examples and manifest. See Build your toolkit for the generated profile and its rules.
4. Integrate#
Use .mini/prompt.en.md as your model's format instruction. Save its response as response.mini.
python .mini/validator.py response.mini
python .mini/parser.py decode response.mini
The second command prints the reconstructed JSON. You can also call loads(text) and dumps(object) after importing the generated parser.py module into your application.
5. Detect and repair#
python .mini/parser.py diagnose response.mini
python .mini/repair.py response.mini --out corrected.mini
Repair normalizes safe wrappers and line endings. It never invents missing values. Changing the declared count requires --fix-count; use it only after checking that the received batch is complete. Semantic errors require an application correction or a model retry.
Included families#
The 14 base-profile families remain available: mini forks, mini prompt log --lang en and mini validate document.mini. Their APIs are documented under Python, TypeScript and CLI.
The playground lets you explore the base profile and compare formats without installing anything.