Support VS Code LM API?

I don't have a separate ChatGPT or Azure OpenAI account, but I do have access to all AI models in VS Code (GitHub Copilot).
It would be nice if LinqPad can support VS Code LM API so it can uses all AI models it has access to.

Comments

  • JoeAlbahari
    edited October 2025

    To my knowledge, Microsoft does not let you access the underlying Copilot models directly (at least not without violating the terms and conditions). Also, it seems that Copilot doesn't offer an option to enable reasoning in GPT 5 and Sonnet 4.5. This might make sense when working with large projects with complex agentic workflows - as it would make the requests take too long - but it would unnecessarily degrade the quality of the responses when working with small scripts. A great benefit of using AI with a code scratchpad is that because you have a relatively small context window and simple agentic workflows, you can enable reasoning.

    Setting up an account with OpenRouter is really easy - you can do it directly from within LINQPad, and then you can access ALL models, with ALL reasoning/thinking options.

    As an experiment, after enabling OpenRouter, press Ctrl+I to bring up LINQPad's AI agent and then ask it to solve a problem, write non-trivial code, or fix an issue with thinking enabled vs disabled. The difference is night and day.

  • I think I mixed up VS Code LM API with GitHub Copilot. VS Code LM API can only used in VS code extension which does not apply to LinqPad.

    I'm wondering if you've looked into GitHub Copilot SDK and see if that is a reasonable path for integration with LinqPad. A quick search shows at least the latest version support reasoning model, and the SDK allows access to the underline models.

    I do have GitHub Enterprise access, which would be nice if I can use it directly with LinqPad.

    Also a not so related topic: I found myself use LinqPad much less since I started to use AI tools like Github Copilot Agent, RooCode. They helped wrote a big portion of my code and most of the time I just ask them to try different things which previously I do it myself in LinqPad.
    I'm thinking maybe LinqPad can help AIs on experiment things by acting as a MCP server?

  • Yes, I've looked into GitHub Copilot SDK. It does not give you direct access to the underlying models, only to its agentic runtime.