Script for easily configuring, using, switching and comparing local offline coding models
1import { OLLAMA_PORT } from "../config.js";
2
3export function aiderConfig(modelName: string): string {
4 return `# =============================================================================
5# Aider Configuration — ${modelName} via Ollama
6# =============================================================================
7
8# Point Aider at Ollama's OpenAI-compatible endpoint
9model: openai/${modelName}
10
11# Architect mode for better code planning
12architect: true
13editor-model: openai/${modelName}
14
15# Git integration
16auto-commits: true
17dirty-commits: true
18attribute-author: false
19attribute-committer: false
20
21# UI preferences
22pretty: true
23stream: true
24dark-mode: true
25
26# Code style
27code-theme: monokai
28show-diffs: true
29
30# Disable analytics
31analytics-disable: true
32`;
33}
34
35export function aiderEnv(): string {
36 return `# Ollama serves an OpenAI-compatible API — no real key needed
37OPENAI_API_KEY=sk-not-needed
38OPENAI_API_BASE=http://127.0.0.1:${OLLAMA_PORT}/v1
39`;
40}