Lessons from Connecting a New Model to an AI Coding Tool
This article reviews what happens after an AI coding tool connects to a new large language model, arguing that poor results usually come from three conflated issues: model capability, integration shape (how context is supplied), and cost structure. It shows how to structure requirements with layered templates, assess repository understanding across retrieval, linking, planning, and execution levels, and turn context feeding into a repeatable workflow. It also covers cost control through prefix caching, model routing, and observability, plus a small internal evaluation set for comparing models objectively. The conclusion is that structured requirements, process-driven context, tiered costs, and metric-based evaluation keep engineering output stable as models iterate quickly.
1. Where the Problem Starts: “Online” Is Not “Usable”
A typical piece of feedback: after an AI coding tool connected to a new-generation large model, a developer wrote a complete requirement into the chat box. The model only read the code already in the project and asked back, “What would you like me to do?” Two or three attempts produced the same result, and the developer gave up on it entirely.
Another piece of feedback was the opposite: the same model performed reasonably on everyday tasks and fell short on complex ones, while a different general-purpose model could solve them. As inference service pricing changed, the cost advantage from cache hits became the main reason to keep using it.
Put together, these two reports do not point to a model being “smart or stupid.” They point to three issues that are often conflated: model capability, integration shape (how context is supplied), and cost structure. Once you separate them, the methodology for selection and invocation becomes clear.
2. When Requirement Descriptions Fail: Why “Writing It All Out” Still Gets a Question Back
When a model asks back about a requirement, it is usually not a comprehension problem but an input-structure problem. A natural-language narrative mixes background, expectations, constraints, and acceptance criteria, and the model cannot tell which are hard constraints and which are optional preferences. So it picks the most conservative strategy: clarify first.
A reusable requirement template layers the information:
[Goal] Add pagination to the order query API, default 20 items per page, maximum 100.[Scope] Change only the query layer and the API layer; do not touch the table schema.[Constraints] Reuse the project's existing response structure and error code conventions; do not introduce new dependencies.[Acceptance] Add cases covering page=0, page greater than the total page count, and size above the limit.[Prohibited] Do not modify shared utility classes; do not change the log format.
The key points: the goal is verifiable, the scope is bounded, the constraints are decidable, and the acceptance criteria are executable. When prohibited items are written out explicitly, the probability of the model refactoring on its own drops noticeably.
3. Four Levels of Project Understanding
To evaluate how a model performs in a real repository, break it down by capability level instead of giving a vague score:
- Retrieval level: Can it locate the relevant files and symbols, rather than wandering through unrelated directories?
- Linking level: Can it follow the call chain to understand upstream and downstream dependencies and identify interface contracts?
- Planning level: Can it break the requirement into ordered change steps and explain the impact of each step?
- Execution level: Are the changes minimal, and do they pass existing checks (compilation, static analysis, tests)?
“Read the code and then ask back” usually gets stuck at levels 1 and 2: insufficient context supply or a failing retrieval strategy. Switching models has limited payoff here; the first thing to fix is the context. Proactively feed in the key files, interface definitions, directory conventions, and existing test cases instead of letting the model feel its way around.
4. Context Engineering: Turning “Feeding” into a Process
Three practices are actionable. First, create a repository guide file that spells out directory responsibilities, naming conventions, and build and test commands, so every session shares the same baseline understanding. Second, trim context on demand: submit only the file fragments relevant to the task, avoiding an overly long context that dilutes key information. Third, plan before coding: require the model to output a change list and risk points first, and execute only after confirmation:
First give a file-level change plan, noting the purpose and risk of each change.I will confirm before you write code; do not modify any files at this stage.
This step seems to add round trips, but it can significantly reduce the cost of the “big change, rollback, big change again” cycle.
5. Cost Structure: Caching, Tiering, and Observability
Price fluctuations are the norm, and cost control cannot rely on a single measure. A generally effective combination is:
- Cache reuse: Put stable system prompts, the repository guide, and convention documents at the prefix of requests to improve prefix cache hit rates and reduce repeated billing;
- Model tier routing: Split traffic by task complexity, sending simple formatting, comments, and unit test completion to lightweight models, and architecture design and difficult defects to strong reasoning models;
- Budget and observability: Record call volume, cache hit rate, and per-task cost for each task type, and use the data to set routing thresholds.
Illustrative routing logic:
def route(task):if task.estimated_tokens < 2000 and task.risk == "low":return "light" # Lightweight model: formatting, comments, unit test completionif task.cross_module or task.risk == "high":return "strong" # Strong reasoning model: cross-module changes, difficult defectsreturn "standard"
Note that specific billing rules and caching strategies are governed by the documentation of the platform you use; this article does not cover any vendor’s specific parameters.
6. Acceptance Checklist: Turning Subjective Impressions into Comparable Metrics
Models iterate frequently, and drawing conclusions from one or two impressions is easy to distort. It is worth maintaining a small internal evaluation set of 10–20 real historical tasks, running it after each model switch or integration change, and recording four metrics: first-pass rate, average number of round trips, lines of manual correction, and per-task cost. After four rounds, selection shifts from “it feels dumber” to “which tasks regressed, and by how much.”
7. Conclusion
Negative experiences after a new model goes online mostly stem from loose requirement expression, insufficient context supply, and misaligned cost expectations, rather than absolute model capability. Structuring requirements, making context a process, tiering costs, and making evaluation metric-based are what keep engineering output stable in an environment where models iterate quickly. If you want to reduce integration and operations costs within the same ecosystem, you can look at Baidu AI Cloud’s combination of general capabilities in model services, container platforms, and logging, monitoring, and alerting, using a unified observability system to support the evaluation and routing processes described above.
