8000 GitHub - MadGoatHaz/AiCockpit: AI-assisted development environment with a Python backend and Next.js frontend.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MadGoatHaz/AiCockpit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ AiCockpit ๐Ÿš€

Your Self-Hosted, AI-Powered Command Center for Local Development & Creativity!

License: MIT Python 3.10+ Next.js 15.3.2 React 19.0.0 Status: Alpha


๐Ÿ“– Table of Contents


๐Ÿ‘‹ Welcome to AiCockpit!

AiCockpit (ACP) is an ambitious open-source project to create a locally hosted backend API and, ultimately, a full-fledged web application. Imagine a powerful, private workspace, running on your own hardware, where you can seamlessly manage Large Language Models (LLMs), orchestrate AI agents, and organize your projects with AI assistance.

Our vision extends far beyond creating a simple alternative to cloud-based AI tools. We aim to build THE definitive, self-hosted, DIY Ai workspace for everyone. AiCockpit is designed to be easily installable, accessible on your local network (or via your own VPN for secure remote access), ensuring your data remains entirely within your control, on your hardware.

While prioritizing local AI and data sovereignty, AiCockpit will also embrace a hybrid approach, enabling you to seamlessly integrate and manage cloud-based AI services alongside your local models. This allows for a powerful collaborative environment where different AI capabilities (local and remote) can contribute to various aspects of your projects.

The ultimate aspiration for AiCockpit is to evolve into a comprehensive, collaborative Ai work environment that verges on being an operating system in itself. We envision a future where you can interact with AiCockpit not just through typing, but through voice commands and other intuitive modalities, unlocking new levels of productivity and creative partnership with AI. It's about building a foundational platform for human-AI collaboration on any conceivable project.

Current Version: 0.2.5-alpha (Backend Stable, Frontend In Progress) Last Updated: May 29, 2024 (Reflecting recent frontend development sprint)


๐ŸŒŸ Core Vision

AiCockpit is not just another AI tool; it's envisioned as the ultimate self-hosted, AI-powered command center for boundless creativity and productivity. We aim to build a deeply integrated workspace where humans and AI collaborate seamlessly on any project imaginable.

AiCockpit aspires to empower you to:

  • ๐Ÿง  Master Your LLMs: Effortlessly discover, download, manage, and interact with a diverse range of local Large Language Models (GGUF focus, with an eye towards future formats and integrations). Go beyond simple chat to fine-tune, experiment, and truly own your AI interactions.
  • ๐Ÿค– Orchestrate Intelligent Agents: Define, configure, and deploy sophisticated AI agents (powered by frameworks like smolagents and beyond). Equip them with tools to automate complex workflows, conduct research, manage tasks, and act as specialized assistants for your projects.
  • ๐Ÿง‘โ€โœˆ๏ธ Supercharge Code Development: From initial scaffolding and boilerplate generation to advanced debugging, code explanation, refactoring, and automated testing, AiCockpit will be an indispensable co-pilot for software engineers.
  • ๐ŸŽจ Unleash Creative Media Generation: Extend beyond text and code. Imagine AiCockpit facilitating image generation, audio synthesis, video assistance, and other multimedia creation tasks by integrating with relevant models and tools, all managed within your local cockpit.
  • โœ๏ธ Elevate Content Creation: Whether you're drafting articles, writing scripts, brainstorming ideas, or translating languages, AiCockpit will provide a rich environment for AI-assisted writing and content development.
  • ๐Ÿ”ฌ Drive Research & Analysis: Utilize AI for data analysis, information retrieval, summarization of complex documents, and accelerating your research endeavors across any domain.
  • ๐Ÿ› ๏ธ Build Your Perfect AI Workspace: The core principle is extensibility and customization. If AiCockpit doesn't have a tool or integration you need, it will be designed to let you build it or plug it in. We envision a rich ecosystem of user-created plugins and extensions.
  • ๐Ÿ—‚๏ธ Achieve Total Project Organization: Manage distinct work sessions, each with its own dedicated file system ("Work Board"), context, and persistent AI memory. Keep your diverse projects, from a software library to a novel, perfectly organized and AI-supercharged.
  • ๐ŸŒ Own Your Data, Own Your AI: By being self-hosted, you maintain full control over your data, your models, and your AI interactions, ensuring privacy and security.
  • ๐Ÿ”ฅ Foster Open Innovation: Built with Python, FastAPI, and a modular architecture (and now Next.js/React for the frontend!), AiCockpit is designed for community contributions. The ultimate dream? AiCockpit becoming so advanced it actively assists in its own development and helps users build the future of AI collaboration!

In short: If you can dream of a project you can do with an AI, AiCockpit aims to be the self-hosted platform that helps you build it, manage it, and take it to the next level.


โœจ Key Features

Backend (Solid & Ready!)

The AiCockpit backend provides a robust set of APIs for:

  • ๐Ÿ”ฎ LLM Management:
    • Discover available GGUF models.
    • Load/unload models (via llama-cpp-python).
    • Stream chat completions using Server-Sent Events (SSE).
  • ๐Ÿง‘โ€โœˆ๏ธ AI Agent Orchestration:
    • Define global and session-specific agent configurations.
    • Execute agents (current smolagents integration is a functional placeholder, ripe for full implementation!).
    • Stream agent outputs via SSE.
  • ๐Ÿ—‚๏ธ Work Session Management:
    • Create, list, update, and delete distinct work sessions.
    • Each session has its own isolated data storage and AI configuration.
  • ๐Ÿ“‹ Workspace File Management (Work Board):
    • Manage files and directories within each session (upload, list, read content, update content, create file/folder, delete file/folder).
  • ๐Ÿ–ฅ๏ธ Interactive Terminal Service:
    • WebSocket endpoint for PTY-based interactive terminal sessions within a workspace's data directory.
  • โš™๏ธ System & Configuration:
    • Endpoints for system health, status, and viewing configurations.
  • ๐Ÿ›ก๏ธ Stability & Testing:
    • Comprehensive test suite (though coverage may vary with new features).
    • Robust dependency injection for modularity.

Frontend (In Progress & Rapidly Evolving!)

The AiCockpit frontend is being built with Next.js (App Router), React, TypeScript, and ShadCN UI for a modern, responsive, and themeable experience.

  • ๐ŸŽจ Core Application Interface:
    • Main Layout: Collapsible sidebar for navigation, dynamic header bar.
    • Responsive Design: Adapts for desktop and mobile viewing, including sheet-based mobile navigation.
    • Theming: Custom HSL-based theme via Tailwind CSS.
    • Notifications: Integrated toaster for user feedback.
  • ๐Ÿงญ Navigation & Layout:
    • AppSidebar with active link highlighting and tooltips when collapsed.
    • HeaderBar with mobile menu, desktop sidebar toggle, and a dropdown for toggling persistent info widgets.
  • ๐Ÿ“Š Dashboard (AiSight Page):
    • KeyMetricsCard components displaying mock data for Active Agents, CPU/Memory Usage, Alerts, etc.
    • SystemHealthChart (bar chart) and ModelPerformanceChart (line chart) with mock data, built using recharts and ShadCN chart components.
  • ๐Ÿ“„ Placeholder Pages: All main navigation items (Workspaces, Logs, Alerts, History, Fleet) have placeholder pages set up within the app layout.
  • โš™๏ธ UI Components (ShadCN based): Core elements like Button, Card, Tooltip, Sheet, DropdownMenu, Tabs, Chart, Dialog, Input, Label, Switch, AlertDialog etc., are integrated.
  • ๐Ÿ’ก Persistent Info Widgets: Toggleable overlay widgets for CPU, Memory, etc., displaying mock data.
  • ๐Ÿงฉ Workspaces Page (/interact): Core Functionality Connected
    • Tabbed Interface: For managing multiple workspaces.
    • CSS Grid Panel Layout: For FileBrowserPanel, EditorPanel, AiChatPanel (with sub-tabs for AI Config & WS Settings), and TerminalManagerPanel.
    • FileBrowserPanel: Full CRUD operations for files & folders, connected to backend.
    • EditorPanel: Fetches, displays, and saves file content to/from backend.
    • AiChatPanel: Streams responses from backend LLM service; uses shared AI model configuration.
    • WorkspaceSettingsPanel: Loads and saves workspace name/description to backend.
    • AIModelConfigurationPanel: Loads and saves AI model (ID, temperature) settings to backend per workspace.
    • TerminalManagerPanel: Connects to backend WebSocket PTY for interactive terminal sessions.
  • ๐Ÿš€ B5C8 **Xterm.js integration with fit and attach addons: โœ… Done!
  • ๐Ÿ”’ **API client for seamless backend communication (including SSE): ๐Ÿšง Partially Done (Implemented on a per-component basis)
  • ๐Ÿ› ๏ธ **Next.js backend proxy/rewrites for API calls: โœ… Done!

๐Ÿ›ฃ๏ธ Roadmap & Current Focus

High Priority: Enhancing the Frontend Web Interface, particularly the "Workspaces" page and connecting it to the backend.

Key Milestones & Next Steps:

  1. ๐ŸŒŸ Frontend Development (Phase 1 - Core UI & Initial Backend Connection)

    • Technology Selection: โœ… Done! (Next.js, React, TypeScript, ShadCN UI, Tailwind CSS)
    • Core Layout & Navigation: โœ… Done! (AppSidebar, HeaderBar, Toaster, basic page structure)
    • Dashboard (AiSight) Implementation: โœ… Done! (KeyMetricsCards, SystemHealthChart, ModelPerformanceChart with mock data)
    • Persistent Info Widgets: โœ… Done! (Toggleable display of mock system stats)
    • Base UI Components (ShadCN): โœ… Done! (Button, Card, Tooltip, Sheet, DropdownMenu, Tabs, Chart, Dialog, Input, Label, Switch, AlertDialog, etc.)
    • Workspaces Page (/interact): ๐Ÿšง Core Functionality Implemented & Connected
      • Tabbed interface for multiple workspaces: โœ… Done!
      • Core styling and theming: โœ… Done!
      • CSS Grid panel layout (FileBrowser, Editor, TerminalManager, AiChat, Settings): โœ… Done!
      • FileBrowserPanel:
        • File/Folder Listing (from backend): โœ… Done!
        • File Upload (to backend): โœ… Done!
        • Create File/Folder (frontend & backend): โœ… Done!
        • Delete File/Folder (frontend & backend): โœ… Done!
      • EditorPanel:
        • Fetch & Display File Content (from backend): โœ… Done!
        • Save File Content (to backend): โœ… Done!
      • AiChatPanel:
        • Connect to streaming chat backend: โœ… Done!
        • Basic UI placeholders for model selection: โœ… Done!
      • WorkspaceSettingsPanel:
        • UI for name/description, auto-save toggle: โœ… Done!
        • Save name/description to backend: โœ… Done!
      • AIModelConfigurationPanel:
        • UI for model selection, temperature: โœ… Done!
        • Fetch/Save AI config to backend: โœ… Done!
        • Share config with AiChatPanel: โœ… Done!
      • TerminalManagerPanel:
        • Connect to backend WebSocket PTY: โœ… Done! (Verification pending stable backend startup)
        • Xterm.js integration with fit and attach addons: โœ… Done!
    • API client for seamless backend communication (including SSE): ๐Ÿšง Partially Done (Implemented on a per-component basis)
    • Next.js backend proxy/rewrites for API calls: โœ… Done!
  2. ๐Ÿค– Backend Enhancements (Foundation & Workspace Features)

    • Core FastAPI setup, modular routers, dependency injection: โœ… Done!
    • LLM Service (/llm endpoints for models, chat completions): โœ… Done!
    • Work Session Management (/sessions endpoints for CRUD, AI config): โœ… Done!
    • Workspace Files Module (/workspaces/sessions/.../files endpoints):
      • Upload, List, Get Content, Update Content, Create, Delete: โœ… Done!
    • Terminal Service (/terminals WebSocket endpoint): โœ… Done! (Verification pending stable startup)
    • Full smolagents Integration: โณ Implement the agent execution logic beyond the current placeholder.
    • Basic User Authentication: โณ Simple, secure auth for a local-first setup.
    • Maintain CONTRIBUTING.md and CODE_OF_CONDUCT.md.

(For a more granular breakdown of the backend's history, see the original AiCockpit outline - Handoff Doc.txt.)

๐Ÿš€ Next Steps / To-Do (Focus: Functional Polish & Core Features)

This section outlines the immediate priorities to bring AiCockpit to a more robust and functionally complete state.

  1. โœ… Verify & Stabilize Core Workspaces (/interact) Functionality:

    • Thoroughly test all interactions between frontend panels (FileBrowser, Editor, AiChat, TerminalManager, Settings) and the live backend.
    • Ensure WebSocket stability for the TerminalManagerPanel.
    • Identify and resolve any persistent errors from backend connections or frontend rendering.
  2. ๐Ÿ’… Frontend Layout & Styling Issues: โœ… Adjusted for better balance.

    • Adjusted CSS grid proportions (grid-rows-[3fr_1fr]) on the /interact page for improved panel balance.
    • Further user-resizable panel investigation deferred (previously attempted with react-resizable-panels causing issues).
  3. ๐Ÿค– Enhance smolagents Integration (Backend & Frontend):

    • Move beyond the current placeholder implementation.
    • Phase 1 Goal: Allow users to select a predefined agent, provide a goal, and stream its output.
    • Design and implement the necessary backend logic and frontend UI components for this.
    • Update (Current Status & Potential Pivot):
      • The smolagents library has been updated to its successor, smol_dev.
      • Significant dependency challenges were encountered with smol_dev (specifically, its reliance on openai-function-call, which requires an older openai<0.28.0 library, conflicting with litellm's need for openai>=1.x).
      • To test smol_dev's core, litellm was temporarily removed, and openai-function-call along with openai==0.27.10 were installed.
      • The immediate next step is to test smol_dev execution with a corrected API request payload.
      • Strategic Consideration: Google's Agent Development Kit (ADK) for Python (google-adk) has been identified as a potentially more robust and feature-rich framework. It offers comprehensive tools for building, evaluating, and deploying agents, with a strong emphasis on modularity and multi-agent systems. ADK might serve as a better foundation for AiCockpit's agent orchestration goals, potentially replacing the smol_dev integration effort. Further investigation and a small spike to test ADK are recommended.
  4. ๐Ÿ”’ Implement Basic User Authentication:

    • Add a simple and secure authentication mechanism (e.g., application-wide password) for local network access.
    • Implement backend endpoints and frontend login UI.
  5. ๐Ÿ› ๏ธ Refine Frontend API Client & State Management:

    • Centralize backend API interaction logic from individual components into a more robust API client module.
    • Evaluate and potentially implement a more comprehensive global state management solution if needed.
  6. ๐Ÿ“ Continuous Documentation & Testing:

    • Keep README.md and ACP Handoffdoc.txt updated.
    • Expand test coverage for new features and fixes.

๐Ÿ› ๏ธ Tech Stack Snapshot

  • Backend: Python 3.10+, FastAPI, Uvicorn
  • LLM Integration: llama-cpp-python (for GGUF models)
  • Agent Framework: smolagents (initial integration)
  • Async & Streaming: asyncio, anyio, sse-starlette
  • Data Validation: Pydantic v2, Pydantic-Settings
  • File Handling: python-multipart
  • Terminal: ptyprocess
  • DevOps: PDM (dependency management), pytest (testing), Ruff (linting), Black (formatting)
  • Frontend:
    • Framework: Next.js (v15.3.2, App Router)
    • UI Library: React (v19.0.0), ShadCN UI
    • Language: TypeScript
    • Styling: Tailwind CSS, CSS Variables (custom theme)
    • Terminal UI: Xterm.js (@xterm/xterm, @xterm/addon-fit, @xterm/addon-attach)
    • Icons: lucide-react
    • Charting: recharts (via ShadCN chart components)

๐Ÿง‘โ€๐Ÿ’ป Getting Started (Developers)

Ready to jump in? Here's how to get AiCockpit up and running:

1. Backend Setup

  • Prerequisites:
  • Clone & Setup:
    git clone https://github.com/your-username/aicockpit.git # Replace with your repo URL
    cd aicockpit
    pdm install -G dev
  • Configure:
    cp example.env .env
    • Edit .env (especially ACP_BASE_DIR, MODELS_DIR).
  • Run the Backend:
    # From the project root directory (e.g., /home/g/Ai/AiCockpit)
    pdm run uvicorn acp_backend.main:app --reload --port 8000
    • Server usually starts on http://127.0.0.1:8000.
    • API docs at http://localhost:8000/docs.

2. Frontend Setup

  • Prerequisites:
    • Node.js (v18.x or later recommended) and npm.
  • Navigate to Frontend Directory:
    # From the project root directory (e.g., /home/g/Ai/AiCockpit)
    cd acp_frontend
  • Install Dependencies:
    npm install
    • This will install Next.js, React, ShadCN UI dependencies, Xterm.js, etc., as defined in package.json.
  • Run the Frontend Development Server:
    # From the acp_frontend directory
    npm run dev
    • The frontend application usually starts on http://localhost:3000 (or an available port if 3000 is in use).

3. Linting & Formatting

  • Backend (from project root):
    pdm run lint
    pdm run format

About

AI-assisted development environment with a Python backend and Next.js frontend.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0