Setting Up an AI Assistant in VS Code
By Darus S Alfatah · 2025-09-10 · Tutorial · 7 menit
Author note: The best extension lets you review the diff before applying changes.
Choosing an Extension
The marketplace is crowded, and most extensions look similar in screenshots. Check three things before installing: whether it supports a custom OpenAI-compatible endpoint, where it stores your key, and whether it shows token usage or cost. Extensions locked to a single provider are usually more expensive and less flexible.
Read the privacy section as well. Some send more context than you expect, including files you did not open. If the extension cannot explain what it transmits, treat that as a warning.
Configuring a Custom Endpoint
Point the extension at your gateway base URL and use a key created for development. Keep a separate key for production so a leaked development key cannot drain the account you depend on.
Set a default model for everyday work and a stronger one for review sessions. Most daily tasks do not need the most capable model, and the cost difference compounds over a month.
Controlling Context
Context is the main driver of both cost and quality. Attach the file you are working on and its immediate dependencies; avoid sending the entire repository for a small question.
When asking about a specific function, select it before prompting. Precise context produces precise answers and reduces the chance of suggestions that ignore your conventions.
Habits That Help
Ask for explanations when a suggestion is unclear, and reject anything you cannot justify. Run the build and tests after accepting changes rather than batching several edits and debugging them together.
Keep a short list of prompts that work for recurring tasks: writing tests, summarising a module, or converting a function to async. Reuse beats reinvention.
Team Consistency
Share a configuration file and a short guide so everyone uses the same model defaults and context limits. Consistency makes reviews faster and prevents one person's expensive experiment from becoming the team's monthly bill.
Frequently Asked Questions
Is inline completion worth it? For boilerplate and repetitive code, yes; for architecture work, no.
How do I stop unwanted context? Disable automatic file inclusion and attach manually.
Can I use it offline? Only with local models, which are weaker but private.
How do I audit usage? Check the gateway dashboard per key.
What about code privacy? Confirm the extension's data policy in writing.
Conclusion
A good setup is boring: one endpoint, one key per environment, deliberate context, and a habit of reviewing every change.
Measuring the Benefit
Track time spent on two recurring tasks before and after adopting the assistant: writing tests and updating documentation. These are measurable, unlike "feeling productive", and they show whether the subscription or token spend is justified.
Also track how often suggestions are rejected. A high rejection rate usually means the context is wrong or the model is mismatched to the task, not that the tool is useless.
Keeping Skills Sharp
Do some tasks without assistance each week. The ability to debug and reason without hints is what you fall back on when the tool is unavailable or wrong, and it is what interviewers assess.
When you accept a suggestion, spend a moment understanding why it works. That small pause converts tool output into knowledge you keep.
An example of reviewing the diff: Before accepting a multi-line change, read the diff and run local tests. A seemingly correct suggestion can alter subtle behaviour.
Frequently Asked Questions
Can beginners follow this tutorial?
Yes. The steps are explained in order with code examples, suitable for beginners and experienced developers alike.
Is BankAI’s endpoint compatible with the library I already use?
Yes, BankAI is 100% OpenAI-compatible, so libraries such as the OpenAI SDK and LangChain work without code changes beyond the Base URL and API key.
Where do I get an API key to follow this tutorial?
You get the API key (and Secret Token) after registering and completing payment in the BankAI dashboard.