- ๐ Welcome to AiCockpit!
- ๐ Core Vision
- โจ Key Features
- ๐ฃ๏ธ Roadmap & Current Focus
- ๐ Next Steps / To-Do (Focus: Functional Polish & Core Features)
- ๐ ๏ธ Tech Stack Snapshot
- ๐งโ๐ป Getting Started (Developers)
- โจ Best Practices & Development Notes
- ๐ค Contributing
- ๐ License
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)
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.
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.
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) andModelPerformanceChart
(line chart) with mock data, built usingrecharts
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), andTerminalManagerPanel
. 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!
High Priority: Enhancing the Frontend Web Interface, particularly the "Workspaces" page and connecting it to the backend.
Key Milestones & Next Steps:
-
๐ 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!
-
๐ค 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
andCODE_OF_CONDUCT.md
.
(For a more granular breakdown of the backend's history, see the original AiCockpit outline - Handoff Doc.txt
.)
This section outlines the immediate priorities to bring AiCockpit to a more robust and functionally complete state.
-
โ 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.
- Thoroughly test all interactions between frontend panels (
-
๐ 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).
- Adjusted CSS grid proportions (
-
๐ค 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 onopenai-function-call
, which requires an olderopenai<0.28.0
library, conflicting withlitellm
's need foropenai>=1.x
). - To test
smol_dev
's core,litellm
was temporarily removed, andopenai-function-call
along withopenai==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 thesmol_dev
integration effort. Further investigation and a small spike to test ADK are recommended.
- The
-
๐ 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.
-
๐ ๏ธ 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.
-
๐ Continuous Documentation & Testing:
- Keep
README.md
andACP Handoffdoc.txt
updated. - Expand test coverage for new features and fixes.
- Keep
- 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)
Ready to jump in? Here's how to get AiCockpit up and running:
- Prerequisites:
- Python 3.10+
- PDM: Install from pdm-project.org
- 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
(especiallyACP_BASE_DIR
,MODELS_DIR
).
- Edit
- 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
.
- Server usually starts on
- 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
.
- This will install Next.js, React, ShadCN UI dependencies, Xterm.js, etc., as defined in
- 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).
- The frontend application usually starts on
- Backend (from project root):
pdm run lint pdm run format