How do I use Leiolai in Aider?

Connect Aider to Leiolai with the OpenAI-compatible base URL, a Leiolai API key, and the model openai/leiolai-1. Start in Aider’s ask mode to discuss a change, then use code mode when you want Aider to edit the files you have added to the conversation.

Which settings connect Aider to Leiolai?

Set OPENAI_API_BASE to https://api.leiolai.com/v1 and OPENAI_API_KEY to your Leiolai key. Start Aider with --model openai/leiolai-1. The openai/ prefix selects Aider’s provider format; leiolai-1 is the Leiolai model identifier.

Which API key should I use?

Use a Leiolai Private-only key for confidential coding work in a client that cannot add mode. An unrestricted key requires mode on every request. Keep the real key in an environment variable or secret setting, away from committed source.

Create the appropriate key

How do I ask about a change before editing?

Use Aider’s /ask command to discuss code and possible changes with Leiolai. Add the files needed to understand the question, describe the expected behavior, and ask for the likely cause or implementation options.

How do I ask Aider to change files?

Use Aider’s /code command when you want Leiolai to edit files. State the change, the files involved, and the result you expect. Review the resulting diff and run the checks appropriate to the change before accepting the edit.

Review a proposed code change

Can I save the model choice for later sessions?

Yes. Use .aider.conf.yml to preserve the relevant Aider settings. Keep the configuration free of real credentials if the file is shared. Continue providing the Leiolai API key through the secret or environment setting used by your shell.

Does a model-metadata warning mean the connection failed?

Aider can warn when model metadata is not built in. Check the actual request result before treating the warning as an authentication failure. Configure Aider’s model metadata from the current Leiolai documentation when you need local context or cost estimates.

What should I check for an unauthorized or unknown-model error?

Check the Leiolai key, /v1 base URL, and exact model setting openai/leiolai-1. Use the request’s error code to choose the correction.

Troubleshoot API errors

How can I make a code question more useful?

Give Leiolai the expected result, observed result, error message, and smallest relevant code excerpt. Ask for an explanation or a focused patch rather than an unspecified rewrite. Keep confidential code in Leiolai Private.

Prepare a useful debugging question