Skip to content

AI Assistant: Qwen Code ​

For this challenge, your AI coding assistant is Qwen Code (the qwen command-line tool) with the model Qwen3 Coder Next (qwen.qwen3-coder-next on Amazon Bedrock).

We pay for it with a prepaid gift card. You do not need an AWS account.

SettingValue
ToolQwen Code CLI (qwen)
ModelQwen3 Coder Next, exposed as qwen-coder
CreditsYour gift card (how to redeem)
Context window256K tokens input, 16K tokens output

Step 1 — Install Node.js 22 or later ​

Qwen Code needs Node.js 22+.

bash
node --version

If the command is missing or shows a version below 22, install Node.js:

bash
brew install node

(No Homebrew? Download the LTS installer from nodejs.org.)

Step 2 — Install Qwen Code ​

bash
npm install -g @qwen-code/qwen-code@latest

Alternatively, with Homebrew:

bash
brew install qwen-code

Check the installation:

bash
qwen --version

Step 3 — Connect Qwen Code ​

  1. Redeem your gift card and run qc key create --write-settings. This writes ~/.qwen/.env:

    bash
    OPENAI_API_KEY=<your key>
    OPENAI_BASE_URL=<our service address>/v1
    OPENAI_MODEL=qwen-coder
  2. Tell Qwen Code to use these settings on startup, so it skips the interactive /auth dialog. Create ~/.qwen/settings.json:

    bash
    touch ~/.qwen/settings.json
    open -e ~/.qwen/settings.json

    Paste and save:

    json
    {
      "security": { "auth": { "selectedType": "openai" } },
      "model": { "name": "qwen-coder" }
    }

    If you already had a settings.json, merge these keys instead of replacing the file.

Step 4 — Test the connection ​

bash
qwen -p "Reply with exactly the word: pong"

Expected output:

text
pong

Each test costs a fraction of a cent. Check with qc usage. If you see an error, go to Troubleshooting.

Step 5 — Use it in your project ​

Open a terminal in your app repository and start an interactive session:

bash
cd ~/code/chatter-ios
qwen

Inside the session:

  • Type requests in plain language, for example: "Create a SwiftUI view for the chats list that shows name, last message, time, and unread badge."
  • /help — list commands.
  • /model — confirm that qwen-coder is active.
  • /doctor — check the configuration and authentication.
  • /quit — exit.

Qwen Code asks before it edits files or runs commands. Read each change before you approve it.

Create a QWEN.md file in the root of your repository. Qwen Code reads it at the start of every session.

markdown
# Project context

- Always respond in English.
- iOS app "Chatter", Swift 6, SwiftUI, iOS 17+.
- API docs: <link to this website>/api/
- Architecture: SwiftUI views -> view models -> repositories -> local store + sync engine.
- Order messages by server `seq`, never by device time.
- Run tests with: xcodebuild test -scheme Chatter -destination 'platform=iOS Simulator,name=iPhone 16'

The line "Always respond in English" matters: without it, the model sometimes answers in Chinese.

Troubleshooting ​

SymptomCauseFix
qwen: command not foundnpm global folder not on PATHRun npm config get prefix, then add <prefix>/bin to PATH in ~/.zshrc. Or install with Homebrew.
Qwen Code opens the /auth dialogsettings.json invalid or missingValidate the JSON (missing comma or brace). The file must be at ~/.qwen/settings.json.
401 Invalid or revoked API keyKey missing, mistyped or revokedRun qc key create --write-settings again.
402 Insufficient creditsBalance is $0Run qc balance. Reply to your invitation email for another card.
429 Too Many RequestsRate limit reachedWait a minute and retry. Use fewer parallel sessions.
Answers in ChineseModel defaultAdd "Always respond in English." to QWEN.md.
Wrong key usedA shell variable or project .env overrides ~/.qwen/.envRun unset OPENAI_API_KEY OPENAI_BASE_URL OPENAI_MODEL, remove them from ~/.zshrc, and do not put them in your project .env.

Rules for AI use ​

  • Use only this assistant (Qwen Code with Qwen3 Coder Next, paid by your gift card) for AI-assisted coding during the challenge.
  • You are responsible for every line. In the interview we ask you to explain and change code, including code the assistant wrote.
  • Add a short "AI usage" section to your README: what you used the assistant for, where it helped, and where you had to correct it.
  • Prompts and responses are logged for 30 days. Do not paste secrets or personal data into prompts.

Questions? Reply to your invitation email.