Customizing the Model
A model configuration file sets the prompt template and the default settings of a model. It uses the LocalAI YAML format. For the syntax, see Advanced usage. The file can be on the local file system, or at a URL such as a GitHub Gist.
LocalAI can be initiated using either its container image or binary, with a command that includes URLs of model config files or utilizes a shorthand format (like huggingface:// or github://), which is then expanded into complete URLs.
The configuration can also be set via an environment variable. For instance:
local-ai github://owner/repo/file.yaml@branch
MODELS="github://owner/repo/file.yaml@branch,github://owner/repo/file.yaml@branch" local-aiHere’s an example to initiate the phi-2 model:
You can also check all the embedded models configurations here.
The model configurations used in the quickstart are accessible here: https://github.com/mudler/LocalAI/tree/master/gallery. Contributions are welcome; please feel free to submit a Pull Request.
The phi-2 model configuration from the quickstart is expanded from https://github.com/mudler/LocalAI-examples/blob/main/configurations/phi-2.yaml.
Example: Customizing the Prompt Template
To modify the prompt template, create a Github gist or a Pastebin file, and copy the content from https://github.com/mudler/LocalAI-examples/blob/main/configurations/phi-2.yaml. Alter the fields as needed:
Then, launch LocalAI using your gist’s URL:
Next Steps
- Visit the advanced section for more insights on prompt templates and configuration files.
- To learn about fine-tuning an LLM model, check out the fine-tuning section.