How lolmaobruhhh/qwen-2-api works
Qwen Chat Proxy Bridge exposes an OpenAI-compatible API and an account-management page. The main workflow routes a chat request through conversation and directive handling, obtains an account token, calls Qwen, then translates streamed output for the client. It also supports model listing and persistent account/conversation state. The graph uses the sampled entry point and core modules; relationships for capabilities described only in the README are marked as documented rather than inferred from unsampled code.
Main entry points: index.js Conversation Handling · auth.js Token Authentication · qwenClient.js Qwen API Client · database.js Account And Conversation Store
Components 13
Proxy Gateway
- Proxy Routes
index.js - Admin Page
lib/page.js - Conversation Handling
index.js - Model Listing
index.js
Accounts And Sessions
- Account Management
index.js - Token Authentication
lib/auth.js - Account And Conversation Store
lib/database.js
Request And Response
- Directive Parsing
lib/translator.js - Response Translation
lib/translator.js
Qwen Integration
- Qwen API Client
lib/qwenClient.js
Other components
- OpenAI Client
- Admin Operator
- Qwen Chat API
Connections 21
- OpenAI Client → Proxy Routes: sends requests
README.md - Admin Operator → Admin Page: opens panel
README.md - Admin Page → Proxy Routes: calls account routes
lib/page.js - Proxy Routes → Admin Page: serves page
index.js - Proxy Routes → Account Management: handles account actions
index.js - Account Management → Account And Conversation Store: reads and updates
index.js - Proxy Routes → Model Listing: routes model requests
index.js - Model Listing → Account And Conversation Store: selects account
index.js - Model Listing → Token Authentication: gets token
index.js - Model Listing → Qwen API Client: fetches models
index.js - Proxy Routes → Conversation Handling: handles chat requests
index.js - Conversation Handling → Directive Parsing: parses directives
index.js - Conversation Handling → Account And Conversation Store: loads and saves state
index.js - Conversation Handling → Token Authentication: gets token
index.js - Conversation Handling → Qwen API Client: sends completion
index.js - Qwen API Client → Qwen Chat API: calls Qwen API
lib/qwenClient.js - Token Authentication → Account And Conversation Store: updates token
lib/auth.js - Token Authentication → Qwen Chat API: signs in
lib/auth.js - Conversation Handling → Response Translation: formats chunks
index.js - Response Translation → OpenAI Client: streams response
README.md - Conversation Handling → Qwen API Client: aborts on disconnect
README.md