Large Language Models

A language model generates the text of a reply. Its voice is configured separately.

Set Up an LLM Connector

Open Configuration → LLM. A connector stores the provider address, model and credentials. A profile decides which connector an NPC uses.

  1. Add your provider key in API Keys.
  2. Create or edit an LLM connector with a recognizable name.
  3. For a provider endpoint, choose Direct OpenAI-compatible endpoint. Configured runtime uses the server configuration; Deterministic mock is for testing.
  4. Enter the full chat-completions URL and exact model identifier. Select the matching credential.
  5. Save, assign the connector to Standard LLM in your profile, and save the profile.
  6. Test a short typed conversation before adding microphone input.

Hosted services can charge for requests. Check pricing, model access and privacy terms with your provider.

Provider Addresses

Use the provider's model identifier, not your connector's friendly name. The editor supports these endpoint formats:

  • OpenRouter: https://openrouter.ai/api/v1/chat/completions
  • OpenAI: https://api.openai.com/v1/chat/completions
  • Google: https://generativelanguage.googleapis.com/v1beta/openai/chat/completions
  • Groq: https://api.groq.com/openai/v1/chat/completions
  • NanoGPT: https://nano-gpt.com/api/v1/chat/completions

These use Direct OpenAI-compatible endpoint. CHIM's provider-specific JSON driver names are not LORKHAN menu options. For local models, start with the launcher's LLM Studio component. Follow the Local LLM Guide to load, test, and connect it.

Profile model slots

  • Standard: The normal conversation choice.
  • Fast: A separate model slot for quicker replies.
  • Powerful: A separate slot for more demanding requests.
  • Experimental: A slot for trying another model.

Assign connectors to these slots in Profiles and save. In Text Chat and Interact, LLM model selects the slot by name; it does not create or download a model. Selecting Fast cannot speed up a slow model if both slots use the same connector.

Background and Dedicated Models

The four conversation slots do not configure every AI task. In Profiles, assign a Diary LLM for diaries. Assign a usable Fallback LLM and enable LLM Fallback to retry failed dialogue through it.

In Global Settings → Global Connectors, review summaries, background and memory tasks, profile tasks, scene classification, relationship management and Director. Director needs its dedicated connector; it does not simply inherit Standard.

Enable and test background features individually after ordinary conversation works.

Prompt guidance

Use Profile Prompt for guidance shared by characters on that profile. Use an NPC’s Prompt Head Override only for character-specific instructions.

Keep guidance concise. Longer prompts, large context and long requested replies can increase latency and cost. LORKHAN uses Markdown-oriented prompting; do not paste XML response templates from another mod.

Test one change at a time

Send the same short request after changing one model assignment. If a reply appears in the server but arrives late as audio, test the voice service separately before blaming the language model.

For local models, follow the Local LLM Guide.