Skip to content

hhdxh1/codemind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  CodeMind โ€” AI-Powered Programming Assistant

Python FastAPI MiMo License
SSE Theme Status

Write โ€ข Debug โ€ข Explain โ€ข Optimize โ€” all through natural conversation with the
Xiaomi MiMo-V2.5-Pro (309B MoE, 100K context) โ€” the #1 open-source model globally.

Features โ€ข Tech Stack โ€ข Quick Start โ€ข Architecture โ€ข API โ€ข Screenshots โ€ข Milestones โ€ข Contributing


๐ŸŒŸ Overview

CodeMind is a full-stack AI programming assistant that connects developers with the cutting-edge Xiaomi MiMo-V2.5-Pro model through an elegant, modern web interface. Built as part of the MiMo Orbit 100T Token Creator Incentive Program, CodeMind demonstrates the full potential of open-source AI in software development.

Why CodeMind?

Challenge CodeMind Solution
Context switching between editor and AI chat Integrated chat + code panel in one interface
Generic AI assistants with no code focus Purpose-built for programming with 14 language modes
Complex setup requirements One-command start: pip install && python run.py
Limited context windows Full 100K token native support from MiMo-V2.5-Pro
No streaming feedback Real-time SSE streaming for instant responses

โœจ Features

๐ŸŽฏ Core Capabilities

Feature Description
๐Ÿ’ฌ Intelligent Chat Conversational code generation with context awareness
๐Ÿ“– Code Explanation Detailed breakdown of complex code in plain language
๐Ÿ” Code Review AI-powered review spotting bugs, security issues, and optimizations
โšก Code Optimization Performance analysis with concrete improvement suggestions
๐Ÿ”„ Multi-Language Supports Python, JS, TS, Java, C++, C#, Go, Rust, Ruby, Swift, Kotlin, SQL, and more

๐ŸŽจ User Experience

  • Dark/Light Theme โ€” Eye-friendly dark mode with elegant glassmorphism, toggle to light theme
  • Streaming Responses โ€” Real-time token-by-token output with zero latency perception
  • Smart Suggestions โ€” One-click prompt chips for common programming tasks
  • Conversation Management โ€” Clear history, context-aware follow-ups
  • Responsive Design โ€” Perfectly optimized for desktop and tablet

๐Ÿ”Œ Integration

  • Xiaomi MiMo API โ€” Direct integration with MiMo-V2.5-Pro's chat completion and streaming endpoints
  • OpenAPI Compatible โ€” Fully documented API at /docs (auto-generated by FastAPI)
  • RESTful Design โ€” Clean, predictable API endpoints with Pydantic validation

๐Ÿ›  Tech Stack

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   CodeMind                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚     Frontend         โ”‚         Backend               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  โ€ข HTML5             โ”‚  โ€ข Python 3.11+               โ”‚
โ”‚  โ€ข CSS3 (Glassmorphism) โ”‚  โ€ข FastAPI (Async)          โ”‚
โ”‚  โ€ข Vanilla JS (ES6+) โ”‚  โ€ข Uvicorn (ASGI Server)      โ”‚
โ”‚  โ€ข Google Fonts      โ”‚  โ€ข httpx (Async HTTP Client)  โ”‚
โ”‚  โ€ข Responsive Design โ”‚  โ€ข Pydantic (Data Validation) โ”‚
โ”‚  โ€ข Dark/Light Theme  โ”‚  โ€ข SSE (Server-Sent Events)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
                         โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚  Xiaomi MiMo API  โ”‚
              โ”‚  MiMo-V2.5-Pro   โ”‚
              โ”‚  (309B MoE)       โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why This Stack?

  • FastAPI โ€” Async-native, automatic OpenAPI docs, best-in-class performance
  • Vanilla JS โ€” Zero dependencies, lightning-fast load times, full control
  • Glassmorphism CSS โ€” Modern aesthetic that screams quality and polish
  • SSE Streaming โ€” Lighter than WebSockets for one-way AI responses, native browser support

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.11 or later
  • pip (Python package manager)
  • A MiMo API key from the Orbit 100T Plan

1. Clone & Install

git clone https://github.com/YOUR_USERNAME/codemind.git
cd codemind
pip install -r requirements.txt

2. Configure

cp .env.example .env
# Edit .env and add your MiMo API key:
#   MIMO_API_KEY=sk-your-key-here

๐Ÿ’ก Get your free API key at 100t.xiaomimimo.com โ€” part of the MiMo Orbit 100 Trillion Token Program.

3. Launch

python run.py

Your CodeMind instance is now running at http://localhost:8000 ๐ŸŽ‰

4. Start Coding!

Open your browser, type a prompt like "Write a Python function to parse JSON from an API response", and watch CodeMind generate production-ready code in real-time.


๐Ÿ— Architecture

                                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                  โ”‚    Browser       โ”‚
                                  โ”‚  (HTML/CSS/JS)   โ”‚
                                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚
                                    HTTP / SSE
                                           โ”‚
                                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                  โ”‚   FastAPI Server โ”‚
                                  โ”‚  (async Python)  โ”‚
                                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚
                                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                  โ”‚   MiMo API Clientโ”‚
                                  โ”‚  (httpx Async)   โ”‚
                                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                           โ”‚
                                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                  โ”‚  Xiaomi MiMo API โ”‚
                                  โ”‚ MiMo-V2.5-Pro    โ”‚
                                  โ”‚ (309B MoE Model) โ”‚
                                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Flow

  1. User types a programming question in the chat interface
  2. Frontend sends the message via POST to /api/chat with stream: true
  3. FastAPI constructs a system prompt + user message and forwards to the MiMo API
  4. MiMo API streams tokens back through Server-Sent Events
  5. Frontend renders each token in real-time with full Markdown + syntax highlighting

Key Design Decisions

Decision Rationale
Async everywhere Non-blocking I/O for concurrent request handling and streaming
Server-Sent Events Lighter than WebSockets, native browser EventSource support, auto-reconnect
Separate frontend/backend Clean separation of concerns, easy to swap either layer
Pydantic validation Type-safe API contracts with automatic error messages
No frontend framework Zero build step, instant loading, maximum performance

๐Ÿ“ก API Reference

All endpoints are automatically documented at http://localhost:8000/docs (Swagger UI).

Method Endpoint Description
GET / Serves the frontend application
GET /api/health Health check + MiMo API status
POST /api/chat Chat completion (supports streaming)
POST /api/explain Explain a piece of code
POST /api/review Review code for bugs and improvements
GET /api/models List available MiMo models

Example: Chat Streaming

import httpx
import json

response = httpx.post(
    "http://localhost:8000/api/chat",
    json={
        "messages": [
            {"role": "user", "content": "Write a binary search in Python"}
        ],
        "stream": True,
        "temperature": 0.7,
        "max_tokens": 4096,
    },
)

for line in response.iter_lines():
    if line.startswith("data: ") and line != "data: [DONE]":
        chunk = json.loads(line[6:])
        print(chunk["content"], end="")

๐Ÿ“ธ Screenshots

Screenshots will be added after deployment. The application features:

View Description
Home Elegant dark-themed welcome screen with suggestion chips
Chat Real-time streaming code generation with syntax-highlighted output
Code Review Detailed AI-powered code analysis with actionable suggestions
Dark/Light Toggle between eye-friendly dark mode and clean light mode

๐Ÿ† Milestones

This project was built as part of the Xiaomi MiMo Orbit 100T Token Creator Incentive Program.

gantt
    title CodeMind Development Timeline
    dateFormat  YYYY-MM-DD
    section Phase 1
    Project Planning & Design      :2026-05-20, 2d
    Backend Development           :2026-05-22, 2d
    Frontend Development          :2026-05-23, 2d
    section Phase 2
    MiMo API Integration          :2026-05-24, 1d
    Testing & Polish              :2026-05-24, 1d
    GitHub Launch                 :2026-05-25, 1d
Loading

Impact & Vision

  • ๐ŸŽฏ Target: Highest tier of the MiMo Orbit 100T Incentive Program
  • ๐ŸŒ Scope: Global developers seeking an open-source AI coding companion
  • ๐Ÿ”ฎ Future: Extend to VSCode extension, CLI tool, and team collaboration features

๐Ÿ“‚ Project Structure

codemind/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ config.py           # Environment & API configuration
โ”‚   โ”œโ”€โ”€ main.py             # FastAPI application & endpoints
โ”‚   โ””โ”€โ”€ mimoclient.py       # MiMo API client (sync + streaming)
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ index.html           # Main SPA application
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ””โ”€โ”€ style.css        # Glassmorphism UI with dark/light themes
โ”‚   โ””โ”€โ”€ js/
โ”‚       โ””โ”€โ”€ app.js           # Frontend logic, streaming, Markdown render
โ”œโ”€โ”€ .env.example             # Environment template
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ README.md                # โ† You are here
โ”œโ”€โ”€ requirements.txt         # Python dependencies
โ””โ”€โ”€ run.py                   # Development server entry point

๐Ÿค Contributing

Contributions are what make the open-source community an amazing place to learn and create. Any contributions you make are greatly appreciated!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for more information.


๐Ÿ™ Acknowledgments

  • Xiaomi MiMo Team โ€” For creating the world-class MiMo-V2.5-Pro model and the Orbit 100T Token Incentive Program
  • ็ฝ—็ฆ่މ โ€” For leading the MiMo-V2.5 series development
  • Open Source Community โ€” For making AI accessible to all

Made with โค๏ธ for the MiMo Orbit 100T Token Creator Incentive Program
Powered by Xiaomi MiMo-V2.5-Pro ยท 309B MoE ยท 100K Context ยท MIT Licensed


๐Ÿ“ ไธญๆ–‡่ฏดๆ˜Ž

CodeMind โ€” ๅŸบไบŽๅฐ็ฑณ MiMo-V2.5-Pro ๆจกๅž‹็š„ AI ็ผ–็จ‹ๅŠฉๆ‰‹

CodeMind ๆ˜ฏไธ€ๆฌพๅ…จๆ ˆ AI ็ผ–็จ‹ๅŠฉๆ‰‹๏ผŒ้€š่ฟ‡ไผ˜้›…็š„็ŽฐไปฃๅŒ–็•Œ้ข๏ผŒๅฐ†ๅผ€ๅ‘่€…ไธŽๅ…จ็ƒ้กถ็บงๅผ€ๆบๆจกๅž‹ ๅฐ็ฑณ MiMo-V2.5-Pro๏ผˆ3090ไบฟๅ‚ๆ•ฐ MoE ๆžถๆž„๏ผ‰่ฟžๆŽฅ่ตทๆฅใ€‚ๆœฌ้กน็›ฎไฝœไธบ ๅฐ็ฑณ MiMo Orbit ็™พไธ‡ไบฟ Token ๅˆ›้€ ่€…ๆฟ€ๅŠฑ่ฎกๅˆ’ ็š„ๅ‚่ต›ไฝœๅ“๏ผŒๅ……ๅˆ†ๅฑ•็คบไบ†ๅผ€ๆบ AI ๅœจ่ฝฏไปถๅผ€ๅ‘ไธญ็š„ๅทจๅคงๆฝœๅŠ›ใ€‚

ๆ ธๅฟƒๅŠŸ่ƒฝ

  • ๐Ÿ’ฌ ๆ™บ่ƒฝๅฏน่ฏ โ€” ่‡ช็„ถ่ฏญ่จ€็”Ÿๆˆ็”Ÿไบง็บงไปฃ็ 
  • ๐Ÿ“– ไปฃ็ ่งฃ้‡Š โ€” ๆทฑๅ…ฅๆต…ๅ‡บๅœฐ่งฃๆžๅคๆ‚ไปฃ็ ้€ป่พ‘
  • ๐Ÿ” ไปฃ็ ๅฎกๆŸฅ โ€” AI ้ฉฑๅŠจ็š„ Bug ๆฃ€ๆต‹ๅ’Œไผ˜ๅŒ–ๅปบ่ฎฎ
  • โšก ๆ€ง่ƒฝไผ˜ๅŒ– โ€” ้’ˆๅฏนๆ€ง็š„ไปฃ็ ๆ€ง่ƒฝๅˆ†ๆž

ๅฟซ้€ŸๅฏๅŠจ

git clone https://github.com/YOUR_USERNAME/codemind.git
cd codemind
pip install -r requirements.txt
# ็ผ–่พ‘ .env ๆ–‡ไปถ๏ผŒๅกซๅ…ฅไฝ ็š„ MiMo API Key
python run.py

่ฎฟ้—ฎ http://localhost:8000 ๅณๅฏๅผ€ๅง‹ไฝฟ็”จ๏ผ

๐Ÿ’ก ๅœจ 100t.xiaomimimo.com ็”ณ่ฏทๅ…่ดน API Key๏ผŒๅ‚ไธŽ็™พไธ‡ไบฟ Token ๆฟ€ๅŠฑ่ฎกๅˆ’๏ผ

About

๐Ÿง  CodeMind โ€” AI-Powered Programming Assistant powered by Xiaomi MiMo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors