skip to content
aMIrmxc-blog ⚙

Table of Contents

How to Use the Best FREE AI Agentic Coding (with Kilo Code + Qwen Code CLI)

Unlock 2,000 FREE AI coding requests per day with this powerful combination

Introduction

Are you tired of expensive AI coding assistants? What if I told you that you could get 2,000 free AI coding requests per day with enterprise-level performance? In this comprehensive guide, I’ll show you how to set up the ultimate free AI coding environment using Kilo Code (an open-source VS Code extension) and Qwen Code CLI from Alibaba Cloud.

This combination gives you:

  • 2,000 requests/day completely FREE
  • 1 million token context window for handling large codebases
  • 60 requests/minute rate limit
  • Zero cost for individual developers
  • ✅ Advanced agentic coding capabilities

What You’ll Learn

By the end of this tutorial, you’ll have a professional AI coding setup that rivals paid solutions like GitHub Copilot or Claude, but without spending a single cent. Let’s dive in!

Prerequisites

Before we begin, make sure you have:

  • Node.js version 20 or higher installed on your system
  • Visual Studio Code (VS Code) installed
  • A Google account or email for Qwen.ai registration
  • Basic familiarity with the command line

Part 1: Understanding the Tools

What is Qwen Code CLI?

Qwen Code CLI is a command-line tool developed by Alibaba Cloud, forked from Google’s Gemini CLI. It provides access to the powerful Qwen3-Coder models:

  • Qwen Free Coder Plus: Smarter model for complex tasks
  • Qwen Free Coder Flash: Faster model for quick iterations

The best part? Alibaba Cloud offers an incredibly generous free tier that’s perfect for individual developers and small teams.

What is Kilo Code?

Kilo Code is an open-source AI coding assistant for VS Code that combines the best features from popular tools like Roo Code and Cline. It offers:

  • Advanced code generation and completion
  • Task automation
  • Context-aware suggestions
  • Support for multiple AI providers
  • Clean, intuitive interface

Part 2: Installing Qwen Code CLI

Step 1: Install Qwen Code Globally

Open your terminal and run:

Terminal window
npm install -g @qwen-code/qwen-code@latest

This will install the latest version of Qwen Code CLI globally on your system.

Step 2: Restart Your Terminal

After installation, close and reopen your terminal to ensure all environment variables are properly loaded.

Step 3: Launch Qwen Code

Simply type:

Terminal window
qwen

You’ll see that Qwen has started but needs authentication.

Step 4: Authenticate with Qwen OAuth

When prompted for authentication method, choose Qwen OAuth. This is crucial because:

  • OAuth gives you the full 2,000 requests/day limit
  • Using OpenAI mode or other methods may impose additional restrictions

The authentication process:

  1. Select “Qwen OAuth” when prompted
  2. Your browser will open to qwen.ai
  3. Click “Continue with Google” (or create a new account)
  4. Authorize the application
  5. Return to your terminal

You’ll know authentication is successful when the terminal stops any unusual behavior and responds normally.

Step 5: Verify Your Setup

Test your installation by asking:

Which model are you?

The response should indicate “Qwen 3 Coder Plus” or similar.

Step 6: Check Your Credentials File

Important: Navigate to your home directory and verify that a credentials file has been created:

  • macOS/Linux: ~/.qwen/credentials
  • Windows: %USERPROFILE%\.qwen\credentials

This file contains your authentication tokens and is essential for the next steps.

Part 3: Installing and Configuring Kilo Code

Step 1: Install the Kilo Code Extension

  1. Open Visual Studio Code
  2. Navigate to the Extensions marketplace (Ctrl/Cmd + Shift + X)
  3. Search for “Kilo Code”
  4. Click “Install” on the Kilo Code extension by kilocode

Step 2: Position Kilo Code for Better Workflow

Pro Tip: Instead of leaving Kilo Code in the left sidebar:

  1. Find the Kilo Code icon in the Activity Bar
  2. Drag it to the right side of your screen
  3. This creates a dedicated panel for AI interactions without blocking your file explorer

Step 3: Configure Kilo Code with Qwen

  1. Click on the Kilo Code icon to open the panel
  2. Navigate to Settings (gear icon)
  3. Click “Create New Configuration Profile”
  4. Name it “Qwen Code” (or any preferred name)
  5. Click “Create Profile”

Step 4: Set Up the API Configuration

Critical Choice: You have two options for configuration:

  • OpenRouter: Limited to ~50 requests/day on free tier
  • Qwen Code: Full 2,000 requests/day

Always choose direct Qwen Code configuration for maximum benefits!

Configure as follows:

  1. Select “Qwen Code” as the provider type
  2. In the credentials field, enter the path to your credentials file:
    • macOS/Linux: ~/.qwen/credentials
    • Windows: %USERPROFILE%\.qwen\credentials

Step 5: Select Your Model

Choose between:

  • Qwen Free Coder Plus: Best for complex logic and problem-solving
  • Qwen Free Coder Flash: Best for quick completions and simple tasks

Both are completely free with the same generous limits!

Step 6: Save and Activate

  1. Click “Save” to store your configuration
  2. Click “Done” to exit settings
  3. Switch to “Ask Mode” in Kilo Code
  4. Select your “Qwen Code” profile from the provider dropdown

Part 4: Using Your AI Coding Assistant

Basic Usage

  1. Ask Questions: Type your coding questions directly in the Kilo Code panel
  2. Code Generation: Request specific functions, classes, or entire programs
  3. Code Review: Paste code and ask for improvements or bug fixes
  4. Explanations: Get detailed explanations of complex code

Example Workflows

Quick Test

Ask: “What model are you?”

You should see:

  • Model name (Qwen Free Coder Plus/Flash)
  • Context window: 1,000,000 tokens
  • No pricing information (because it’s free!)

Code Generation Example

Create a Python function that sorts a list of dictionaries by multiple keys

Debugging Example

This JavaScript function isn't working correctly. Can you help me fix it?
[paste your code]

Context Window Management

While the model advertises a 1 million token context window, keep in mind:

  • Practical limit: Stay under 400,000 tokens for best performance
  • Models may start hallucinating or forgetting instructions with very large contexts
  • Monitor your token usage in the Kilo Code interface

Part 5: Advanced Tips and Best Practices

1. Switching Between Models

  • Use Flash for:
    • Quick completions
    • Simple refactoring
    • Basic explanations
  • Use Plus for:
    • Complex algorithms
    • Architecture decisions
    • Detailed code reviews

2. Managing Your Free Tier

  • 2,000 requests/day resets at midnight (your local time)
  • 60 requests/minute prevents abuse but allows continuous coding
  • No token counting needed - requests are counted instead

3. Troubleshooting Common Issues

Authentication Issues:

  • Ensure you’re using Qwen OAuth, not OpenAI mode
  • Check that your credentials file exists and has proper permissions

Model Not Responding:

  • Verify your internet connection
  • Check if you’ve hit the rate limit (60 req/min)
  • Restart VS Code if necessary

Windows Path Issues:

  • Use forward slashes even on Windows: C:/Users/YourName/.qwen/credentials
  • Or use environment variables: %USERPROFILE%\.qwen\credentials

4. Maximizing Productivity

  • Use specific prompts: Be clear about what you want
  • Provide context: Include relevant code snippets
  • Iterate quickly: Use Flash for rapid prototyping, then Plus for refinement
  • Save templates: Create prompt templates for common tasks

Part 6: Comparison with Other Solutions

FeatureQwen + Kilo CodeGitHub CopilotClaude CodeCursor
Monthly CostFREE$10-19$20+$20
Daily Requests2,000Unlimited*LimitedLimited
Context Window1M tokens8k tokens200k tokensVaries
Open SourceYes (Kilo Code)NoNoNo
IDE SupportVS CodeMultipleTerminalCustom IDE

*GitHub Copilot has soft limits and throttling

Conclusion

Congratulations! You now have a professional-grade AI coding assistant that’s completely free. The combination of Qwen Code CLI’s generous free tier and Kilo Code’s powerful features gives you capabilities that rival or exceed many paid solutions.

Key Takeaways:

  • ✅ 2,000 free requests per day is more than enough for full-time development
  • ✅ The 1 million token context window handles even large codebases
  • ✅ Kilo Code provides a superior interface compared to terminal-only tools
  • ✅ You’re not locked into any ecosystem - everything is open source

What’s Next?

  1. Experiment with different prompt styles to find what works best
  2. Explore Kilo Code’s advanced features like task automation
  3. Join the Kilo Code community for tips and updates
  4. Share this guide with fellow developers who could benefit from free AI coding

Remember: This free tier is promotional and may change in the future, so take advantage while it lasts!


Did this guide help you? Follow for more tutorials on AI-assisted development and open-source tools. Happy coding!

Resources

What is your opinion?

Loading comments...