惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
宝玉的分享
宝玉的分享
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
博客园 - Franky
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
T
Threatpost
aimingoo的专栏
aimingoo的专栏
博客园_首页
Know Your Adversary
Know Your Adversary
T
Threat Research - Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Security Latest
Security Latest
T
Tailwind CSS Blog
The Hacker News
The Hacker News
P
Palo Alto Networks Blog
Latest news
Latest news
G
GRAHAM CLULEY
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
A
Arctic Wolf
D
Darknet – Hacking Tools, Hacker News & Cyber Security
I
InfoQ
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 叶小钗
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
罗磊的独立博客
博客园 - 聂微东
Simon Willison's Weblog
Simon Willison's Weblog
Scott Helme
Scott Helme
T
Tenable Blog
O
OpenAI News
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
美团技术团队

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Zero-Cost AI in VS Code
DmitryGanin · 2026-05-24 · via DEV Community

Zero-Cost AI: Accessing Premium Models in VS Code Without API Keys

How I built a VS Code extension that gives you free access to Qwen-Max and DeepSeek models using only your existing web account — no billing, no tokens, no limits.


🎯 The Problem with Modern AI Tools

The state of AI development has become expensive:

  • API keys needed for every provider
  • Per-token pricing that adds up quickly
  • Rate limits blocking your workflow
  • Multiple subscriptions to different services
  • Browser sessions constantly expiring

Premium AI services charge significant monthly fees:

  • ChatGPT Plus: $20/month
  • Claude Pro: $20/month
  • Gemini Advanced: $20/month

That's over $600/year for basic access! And you still need separate accounts for each service.

What if there was another way?


💡 The Solution: Browser-Based Authentication

I developed AI Free VSCode — an open-source extension that leverages your existing free tier accounts from AI providers through browser automation.

Key Innovation

Instead of requiring API keys (which often have strict rate limits), the extension:

  1. Uses Playwright to automate a real Chromium browser session
  2. Stores authentication cookies locally
  3. Makes requests through the official web APIs
  4. Gives you full access to the same free tier available on their websites

Result?

Zero cost - uses existing free accounts

No API keys - just sign in once

Higher limits - same as browsing the website

Native integration - works directly in Copilot Chat

Agent mode - full tool calling support


🏗 Architecture Overview

Extension Structure

ai-free-vscode/
├── src/
│   ├── extension.mjs          # Entry point & commands
│   ├── lmProvider.mjs         # Unified LM provider interface
│   ├── deepseek/
│   │   ├── auth.mjs           # Browser login with Playwright
│   │   ├── client.mjs         # API client implementation
│   │   ├── provider.mjs       # Model logic & session management
│   │   └── config.mjs         # Configuration constants
│   ├── qwen/
│   │   ├── auth.mjs           # Qwen authentication
│   │   ├── client.mjs         # Qwen API client
│   │   └── provider.mjs       # Qwen model implementation
│   ├── utils/
│   │   ├── logger.mjs         # Debug logging
│   │   ├── rateLimiter.mjs    # Rate limiting protection
│   │   ├── responseValidator.mjs
│   │   └── tokenValidator.mjs
│   └── promptUtils.mjs        # Message formatting
├── package.json               # Extension manifest
└── README.md                  # Documentation

Enter fullscreen mode Exit fullscreen mode

Core Components

1. Authentication Flow

The extension registers commands for users to authenticate:

context.subscriptions.push(
  vscode.commands.registerCommand("deepseek.login", async () => {
    await clearProfileSession(); // Clear old session
    const result = await loginAndSaveAuth(); // New login via Playwright
    auth.cookieHeader = result.cookieHeader;
    auth.token = result.token;
  }),
);

Enter fullscreen mode Exit fullscreen mode

Process:

  • Opens Chromium browser via Playwright
  • User signs into provider normally
  • Session cookies captured and stored locally
  • Cookies used for subsequent API requests

2. Unified Provider Interface

All models are unified under a single vendor namespace:

class AiFreeVscodeChatModelProvider {
  async provideLanguageModelChatResponse(
    model,
    messages,
    options,
    progress,
    token,
  ) {
    // Convert VS Code messages to API format
    const convertedMessages = convertMessages(messages);
    const tools = convertToolSchemas(options?.tools);
    const prompt = messagesToPrompt(convertedMessages, tools);

    // Route to appropriate provider
    switch (model.family) {
      case "deepseek":
        await deepseekComplete({ modelId, prompt, auth, onText, signal });
        break;
      case "qwen":
        await qwenComplete({
          modelId,
          prompt,
          auth,
          onText,
          onThinking,
          signal,
        });
        break;
    }
  }
}

Enter fullscreen mode Exit fullscreen mode

Process:

  • Routes VS Code chat requests to appropriate provider
  • Handles both DeepSeek and Qwen models
  • Converts messages to API format
  • Manages streaming responses

3. Smart Session Management

Maintains conversation continuity with session caching:

const sessionIdCache = new Map();

async function runComplete({
  modelId,
  prompt,
  auth,
  threadKey,
  messagesCount,
}) {
  // Start fresh session for first message in thread
  if (messagesCount === 1) {
    sessionIdCache.delete(threadKey);
  }

  // Try cached session first (for conversation continuity)
  const cachedSessionId = sessionIdCache.get(threadKey);
  if (cachedSessionId) {
    const ok = await attempt(cachedSessionId);
    if (ok) return; // Success!
  }

  // Retry with new session
  const sessionId = await client.createSession({ signal });
  sessionIdCache.set(threadKey, sessionId);
  await attempt(sessionId);
}

Enter fullscreen mode Exit fullscreen mode


🔧 Installation & Setup

Step 1: Install the Extension

Download the latest .vsix file from Releases and install via VS Code Extensions panel.

Or develop locally:

git clone https://github.com/AppsGanin/ai-free-vscode
cd ai-free-vscode
npm install  # installs dependencies + Playwright Chromium

Enter fullscreen mode Exit fullscreen mode

Press F5 to launch in Extension Development Host.

Step 2: Sign In to Provider

  1. Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Run "AI Free VSCode: DeepSeek: Sign In (Playwright)"
  3. A browser window opens automatically
  4. Log in to your account normally
  5. Window closes when session is saved

Repeat for Qwen or other supported providers.

Step 3: Start Chatting

  • Open Copilot Chat panel (⌘+L)
  • Select your preferred model from dropdown
  • Start asking questions!

🚀 Supported Models

Model ID Max Tokens Use Case
DeepSeek V4 deepseek-default 8K output General purpose
DeepSeek V4 Expert deepseek-expert 8K output Complex reasoning
Qwen2.5-Max qwen-max - Powerful tasks
Qwen3.6-Plus qwen-plus 1M context Long documents
Qwen3-Max qwen3-max - Flagship quality
Qwen3-Coder qwen-coder 1M context Code generation
Qwen3.5-Flash qwen-flash - Fastest responses

All models support tool calling for Agent mode operations like:

  • File reading/writing
  • Terminal execution
  • Multi-step debugging
  • Code refactoring

🛠 Technical Deep Dive

How Messages Are Processed

1. Message Conversion

VS Code messages are converted to API-compatible format:

function convertMessages(messages) {
  return messages
    .map((msg) => {
      const role = msg.role === "assistant" ? "assistant" : "user";

      // Handle text content
      const content = msg.content
        .map((part) =>
          part instanceof LanguageModelTextPart ? part.value : "",
        )
        .join("");

      // Extract tool calls from assistant
      const toolCalls = msg.content
        .filter((p) => p instanceof LanguageModelToolCallPart)
        .map((p) => ({
          id: p.callId,
          type: "function",
          function: { name: p.name, arguments: JSON.stringify(p.input) },
        }));

      // Generate separate "tool" messages for results
      const toolResults = msg.content
        .filter((p) => p instanceof LanguageModelToolResultPart)
        .map((p) => ({
          role: "tool",
          tool_call_id: p.callId,
          content: p.content.value,
        }));

      return [
        ...toolResults,
        { role, content, tool_calls: toolCalls.length ? toolCalls : undefined },
      ];
    })
    .flat();
}

Enter fullscreen mode Exit fullscreen mode

2. Tool Call Detection

The system detects markdown fences indicating tool calls:

const TOOL_FENCES = ["`\`\`tool_call", "\ntool_call\n{", "tool_call\n{"];

function findFence(str) {
  let best = -1;
  for (const fence of TOOL_FENCES) {
    const idx = str.indexOf(fence);
    if (idx !== -1 && (best === -1 || idx < best)) best = idx;
  }
  return best;
}

// Stream processing
streamBuf += text;
const idx = findFence(streamBuf);
if (idx !== -1) {
  // Emit text before fence, suppress tool call block
  flushStream(streamBuf.slice(0, idx));
  streamBuf = "";
  inToolCall = true;
}

Enter fullscreen mode Exit fullscreen mode

This prevents raw tool call blocks from appearing in the chat UI while still executing them properly.

3. Thinking Mode Support

For models with explicit reasoning phases:

let thinkingStarted = false;
let thinkingText = "";

const onThinking = async (text) => {
  thinkingText += text;
  thinkingStarted = true;
};

// When content starts, emit thinking as collapsible block
if (thinkingStarted) {
  progress.report(new LanguageModelThinkingPart(thinkingText, "thinking-0"));
}

Enter fullscreen mode Exit fullscreen mode

VS Code displays this as a native collapsible "💭 Thinking" section above responses.


🔐 Security & Privacy

What Happens to Your Data?

Cookies stored locally - Only your machine, encrypted by OS
No cloud storage - We never transmit your credentials
Session isolation - Each provider maintains separate sessions
No telemetry - No usage statistics sent anywhere

Error Handling

try {
  await client.complete({ ... });
} catch (e) {
  // Graceful handling of various errors
  if (e.isNotSignedIn) {
    showErrorMessage("Please sign in first");
  } else if (e.isAuthError) {
    // Cookie expired - force re-login
    clearProfileSession();
    throw e;
  } else if (isBizError(e)) {
    // Business logic error with formatted message
    progress.report(new TextPart(formatBizError(e.bizCode, e.bizMsg)));
  }
}

Enter fullscreen mode Exit fullscreen mode

⚠️ Limitations & Caveats

Important Considerations

  1. Terms of Service - Automating browser sessions may violate provider ToS
  2. Account Risk - Your account could be restricted (use at your own risk)
  3. Stability - Providers can change APIs without notice
  4. Single Session - Only one active user session at a time
  5. No Enterprise Support - Not suitable for corporate compliance requirements

Mitigation Strategies

  • Use separate accounts from main email
  • Don't abuse the service (reasonable usage only)
  • Keep extension updated for API changes
  • Maintain backups of important code/settings

🚀 Real-World Use Cases

Scenario 1: Code Review Assistant

# Ask about potential bugs
User: "Review this Python function for memory leaks:"
[User pastes code]

Assistant: Analyzes code structure, identifies resource leaks,
suggests fixes with explanations

Enter fullscreen mode Exit fullscreen mode

Scenario 2: Database Query Optimization

-- Paste slow query
EXPLAIN SELECT * FROM users WHERE created_at > NOW() - INTERVAL '7 days';

Assistant: Suggests indexing strategies, query rewriting,
and alternative approaches

Enter fullscreen mode Exit fullscreen mode

Scenario 3: Full Stack Debugging

  1. Identify error in terminal
  2. Ask assistant to analyze stack trace
  3. Get root cause explanation
  4. Receive fix suggestion with code example
  5. Apply fix directly in editor

🤝 Contributing

This is an open-source hobby project built by enthusiasts, for enthusiasts.

Ways to contribute:

  1. Fix bugs - See open issues
  2. Add new models - Implement additional AI providers
  3. Improve docs - Clarify setup instructions
  4. Enhance UX - Better error messages, UI improvements
  5. Write tests - Increase coverage for edge cases

Getting started:

git clone https://github.com/AppsGanin/ai-free-vscode
cd ai-free-vscode
npm install
# Edit code, press F5 to test

Enter fullscreen mode Exit fullscreen mode

Contributions welcome! PRs are always appreciated.


📝 Legal Disclaimer

This extension is unofficial and not affiliated with any AI provider.

  • Use at your own risk - Automating web sessions may violate ToS
  • No guarantees - May stop working if providers change APIs
  • No liability - Authors not responsible for consequences

Always review Terms of Service before use.


🎯 Conclusion

AI Free VSCode demonstrates that you don't need expensive API keys or multiple subscriptions to access premium AI capabilities. By leveraging browser automation and existing free tiers, we've created a solution that:

  • 💰 Costs nothing - literally $0 monthly subscription
  • 🚀 Works instantly - one-time sign-in, perpetual access
  • 🔒 Respects privacy - all data stays local
  • 🛠️ Integrates seamlessly - native VS Code experience

Whether you're a student learning to code, a indie developer building your startup, or just someone who wants powerful AI tools without breaking the bank - this extension removes financial barriers and puts cutting-edge technology in your hands.


Ready to try it?

Let's democratize AI access together! 🚀