### Model Descriptor JSON Format Source: https://github.com/lmstudio-ai/model-catalog/blob/main/README.md A single JSON file describes a model, its authors, additional resources, and available model files. Version 0.0.1 captures model size, architecture, file format, and quantization format. ```json { "modelName": "guanaco-7b", "version": "0.0.1", "authors": [ "Tim Dettmers" ], "description": "Guanaco is a 7B parameter model based on Llama.", "sources": [ { "name": "Hugging Face", "url": "https://huggingface.co/TheBloke/guanaco-7B-GGML" } ], "modelFiles": [ { "name": "guanaco-7b.ggmlv3.q4_0.bin", "provider": "TheBloke", "size": "4.08 GB", "format": "ggml", "quantization": "q4_0" } ] } ``` -------------------------------- ### Catalog JSON Generation and Validation Source: https://github.com/lmstudio-ai/model-catalog/blob/main/README.md A Github action merges individual model JSON files into a single catalog.json. Another action validates these files against a JSON schema. The `validate.py` tool or `createCatalog.py` script can be used for local validation. ```python import json import os def validate_model_file(filepath): with open(filepath, 'r') as f: model_data = json.load(f) # Add validation logic here based on the schema print(f"Validating {filepath}...") return True def create_catalog(models_dir='models', output_file='catalog.json'): catalog = [] for filename in os.listdir(models_dir): if filename.endswith('.json'): filepath = os.path.join(models_dir, filename) if validate_model_file(filepath): with open(filepath, 'r') as f: catalog.append(json.load(f)) with open(output_file, 'w') as f: json.dump(catalog, f, indent=2) print(f"Catalog created at {output_file}") if __name__ == "__main__": # Example usage: # Create dummy model files for testing if not os.path.exists('models'): os.makedirs('models') with open('models/guanaco-7b.json', 'w') as f: json.dump({"modelName": "guanaco-7b"}, f) with open('models/samantha-1.1-llama-7b.json', 'w') as f: json.dump({"modelName": "samantha-1.1-llama-7b"}, f) create_catalog() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.