model is written by create --model and changed by set model. On a terminal, set model with no value opens the same searchable list as the wizard. At deploy it becomes spec.model in .telnyx/index.ts, and buildHarness() in managed/agent.ts builds the language model from it:
model becomes the harness spec’s model. It is an AI SDK v6 language model, which chatLanguageModel implements over the chat completions.
chatLanguageModel and telnyxChatCompletions are in managed/model.ts. The call goes to the Telnyx inference endpoint through the TELNYX binding of the instance’s env, as ai.openai.chat.createCompletion, and for a third-party model the key stored as a secret is added to the request as api_key. A host that supplies model replaces the language model outright; one that supplies completions keeps spec.model and changes the endpoint it is served from.