mlc_llm_gen_config generates the chat configuration required after converting a model’s weights to MLC LLM format. It records model-specific settings, including quantization and the chat template, for subsequent compilation and deployment. section 11.3 section 11.5
The command operates between model preparation and platform-specific compilation:
- Reads the directory containing the cloned model weights and configuration. section 11.3
- Takes a quantization type and model chat template, such as q4f16_1 and redpajama_chat. section 11.3
- Writes the generated configuration to the same output directory used for converted weights. section 11.3
- Produces mlc-chat-config.json, which later specifies how MLC LLM compiles the model library for a target device. section 11.3 section 11.5
Generate a RedPajama chat configuration
mlc_llm gen_config ./RedPajama-INCITE-Instruct-3B-v1/ --quantization q4f16_1 --conv-template redpajama_chat -o dist/RedPajama-INCITE-Instruct-3B-v1-q4f16_1-MLC/ section 11.3
Figure 11.3 The end-to-end workflow for MLC LLM, from model conversion to deployment on the supported platforms’ native runtimes
Use the end-to-end workflow to place configuration generation between model conversion and deployment on a supported platform runtime. section 11.3
