eyaltoledano/claude-task-master · error
Base URL is required for OpenAI-compatible providers. Please
Error message
Base URL is required for OpenAI-compatible providers. Please provide a baseURL.
What it means
Thrown by setModel when the user sets a model with the --openai-compatible provider hint but no baseURL can be resolved. Unlike LM Studio, OpenAI-compatible providers have no sensible default endpoint, so the library refuses to save a config entry that would be unusable. The base URL must come from the --base-url flag or from an existing baseURL already stored for that role while the provider was already OPENAI_COMPATIBLE.
Source
Thrown at scripts/modules/task-manager/models.js:668
// Get current provider for this role to check if we should preserve baseURL
let currentProvider;
if (role === 'main') {
currentProvider = getMainProvider(projectRoot);
} else if (role === 'research') {
currentProvider = getResearchProvider(projectRoot);
} else if (role === 'fallback') {
currentProvider = getFallbackProvider(projectRoot);
}
// Only preserve baseURL if we're already using OPENAI_COMPATIBLE
const existingBaseURL =
currentProvider === CUSTOM_PROVIDERS.OPENAI_COMPATIBLE
? getBaseUrlForRole(role, projectRoot)
: null;
const resolvedBaseURL = baseURL || existingBaseURL;
if (!resolvedBaseURL) {
throw new Error(
`Base URL is required for OpenAI-compatible providers. Please provide a baseURL.`
);
}
warningMessage = `Warning: Custom OpenAI-compatible model '${modelId}' set with base URL '${resolvedBaseURL}'. Taskmaster cannot guarantee compatibility. Ensure your API endpoint follows the OpenAI API specification.`;
report('warn', warningMessage);
// Store the computed baseURL so it gets saved in config
computedBaseURL = resolvedBaseURL;
} else {
// Invalid provider hint - should not happen with our constants
throw new Error(`Invalid provider hint received: ${providerHint}`);
}
}
} else {
// No hint provided (flags not used)
if (modelData) {
// Found internally, use the provider from the internal list
determinedProvider = modelData.provider;
report(View on GitHub (pinned to c0c98d367c)
Solutions
- Pass the endpoint with --base-url, e.g. `task-master models --set-main=my-model --openai-compatible --base-url=https://my-endpoint/v1`
- If the role already used an OpenAI-compatible provider, verify its baseURL exists in .taskmaster/config.json under models.<role>.baseURL so it can be preserved; otherwise set it explicitly
- Use the LM Studio hint instead (it defaults to http://localhost:1234/v1) only if that is actually your setup
- Programmatically, call setModel with baseURL in the options object
Example fix
// before task-master models --set-main=llama-3-70b --openai-compatible // after task-master models --set-main=llama-3-70b --openai-compatible --base-url=https://api.together.xyz/v1
Defensive patterns
Strategy: validation
Validate before calling
import { getBaseUrlForRole } from './utils.js';
function assertBaseURL(baseURL, role, projectRoot, currentProvider, CUSTOM_PROVIDERS) {
const existing = currentProvider === CUSTOM_PROVIDERS.OPENAI_COMPATIBLE
? getBaseUrlForRole(role, projectRoot) : null;
if (!baseURL && !existing) {
throw new Error(`--base-url is required when setting an OpenAI-compatible model for role '${role}'`);
}
} Type guard
function hasBaseUrl(opts) {
return typeof opts.baseURL === 'string' && opts.baseURL.trim().length > 0;
} Try / catch
try {
await setModel(projectRoot, role, modelId, { providerHint: 'OPENAI_COMPATIBLE', baseURL });
} catch (err) {
if (/Base URL is required/i.test(err.message)) {
console.error('Provide --base-url, e.g. --base-url=https://your-endpoint/v1');
} else throw err;
} Prevention
- Always pair --openai-compatible with --base-url in scripts and docs
- Keep baseURL persisted in .taskmaster/config.json for the role so repeat sets preserve it
- Remember baseURL is only preserved when the role's current provider is already OPENAI_COMPATIBLE
- Sanity-check the endpoint ends with the OpenAI-compatible path (often /v1)
When it happens
Trigger: Calling setModel (or `task-master models --set-main=<id> --openai-compatible`) with a custom model ID and the OPENAI_COMPATIBLE provider hint, where the --base-url flag is omitted AND the role's current provider is not already OPENAI_COMPATIBLE (so no existingBaseURL is preserved).
Common situations: First-time setup of a custom OpenAI-compatible endpoint (vLLM, LiteLLM proxy, Together, etc.) where the user forgot --base-url; switching from another provider (e.g. openrouter) to openai-compatible and assuming the old baseURL carries over — it deliberately does not; scripting the models command and dropping the flag.
Related errors
- Invalid provider hint received: ${providerHint}
- ${this.name} API key is required
- ${this.name} Model ID is required
- Provider name is required
- API key environment variable name is required
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/b966d69f35989585.
Report an issue: GitHub.