{"id":33870887,"url":"https://github.com/nesall/phenixcode","last_synced_at":"2026-03-07T04:32:28.341Z","repository":{"id":317027920,"uuid":"1065720586","full_name":"nesall/phenixcode","owner":"nesall","description":"Privacy-focused, self-hosted RAG assistant for querying codebases with local or cloud LLMs.","archived":false,"fork":false,"pushed_at":"2026-01-24T19:25:48.000Z","size":35910,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-25T05:48:12.661Z","etag":null,"topics":["ai-coding-assistant","code-assistant","copilot-alternative","cpp","developer-tools","embeddings","llm","local-llm","privacy","rag","self-hosted"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nesall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-28T09:48:40.000Z","updated_at":"2026-01-24T19:14:12.000Z","dependencies_parsed_at":"2025-10-16T19:40:13.607Z","dependency_job_id":"b1341b17-9e18-4703-b1e6-5a6fb0476fa5","html_url":"https://github.com/nesall/phenixcode","commit_stats":null,"previous_names":["nesall/embedder_cpp","nesall/phenixcode"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/nesall/phenixcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesall%2Fphenixcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesall%2Fphenixcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesall%2Fphenixcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesall%2Fphenixcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nesall","download_url":"https://codeload.github.com/nesall/phenixcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesall%2Fphenixcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30208040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding-assistant","code-assistant","copilot-alternative","cpp","developer-tools","embeddings","llm","local-llm","privacy","rag","self-hosted"],"created_at":"2025-12-09T23:00:33.228Z","updated_at":"2026-03-07T04:32:28.273Z","avatar_url":"https://github.com/nesall.png","language":"C++","readme":"[![License](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\n# PhenixCode Assistant\n\nA self-hosted RAG system for querying codebases with AI. Index your code locally, search with semantic meaning, and get context-aware answers using local or cloud LLMs.\n\n**Built for developers who want:**\n- **Privacy** – Your code never leaves your machine\n- **Zero subscriptions** – Run entirely on local models (no monthly fees)\n- **Flexibility** – Switch between local and cloud LLMs as needed\n\nWorks offline with local models or integrates with OpenAI-compatible APIs. Your data, your infrastructure, your choice.\n\n![PhenixCode UI](media/demo.gif)\n\n*Complete control and full customization*\n\n![PhenixCode Admin Dashboard](media/dashboard0.png)\n\n**Key features:** Local embeddings • Fast vector search (HNSWLib) • SQLite metadata • JWT auth • HTTP API • Single JSON config\n\n**[Download release](https://github.com/nesall/phenixcode/releases/latest)** | **[Quick start](#quick-start)**  \n\n### Why Self-Host?\n\n**GitHub Copilot:** $10–20/month, cloud-only, limited customization  \n**PhenixCode:** Free with local models or your own APIs, fully customizable  \n*Note: PhenixCode focuses on chat-based code assistance, not inline code auto-complete.*  \n\n### Features overview\n\nCore Functionality:  \n* Lightweight tokenization  \n* Smart chunking with overlap  \n* Local embeddings (llama-server + any choice of embedding model)  \n* Both local and remote completion models of your choice\n* Fast vector search (Hnswlib with cosine similarity)  \n* Metadata storage (SQLite)  \n* Incremental updates with file tracking  \n* CLI + HTTP API  \n\nAPI \u0026 Server:  \n* HTTP API server (httplib)  \n* REST endpoints (/api/search, /api/chat, /api/embed)  \n* Metrics endpoint (JSON + Prometheus format)  \n* Health checks  \n* Graceful shutdown  \n\nSecurity:  \n* JWT token authentication  \n* Password management (CLI-based)  \n* Protected admin endpoints  \n* Hashed password storage  \n\nDeployment \u0026 Operations:  \n* Console setup wizard (interactive)  \n* Web setup wizard (password protected)\n* Service installation scripts (Windows/Linux/macOS)  \n* Structured logging (output.log + diagnostics.log)  \n* Auto-start on boot (systemd/NSSM/LaunchAgent)  \n* Release packaging (build_rel scripts)  \n\nConfiguration:  \n* Template-based settings.json  \n* Environment variable overrides  \n* CLI parameter support  \n* Multiple source types (directories, files, URLs)  \n\n\u003ca name=\"quick-start\"\u003e\u003c/a\u003e\n### Quick Start (Prebuilt Binaries)\n\n  1. **Download** the latest release for your platform  \n  2. **Extract the package**. The included `settings.json` is pre-configured for a local, private setup.  \n  3. **Start Local LLMs**: Since the default configuration uses local models, you must start the necessary servers first.  \n  The simplest way is using llama-server (or a similar tool):  \n```\n# 1. Start Embedding Server (e.g., CodeRankEmbed)\n# The current settings.json is configured for this default:\n./llama-server -m ./coderankembed-q4_k_m.gguf --embedding --pooling cls -ub 8192 --port 8584 \u0026\n\n# 2. Start Generation Server (e.g., Qwen)\n# The current settings.json is configured for this default:\n./llama-server -m ./qwen2.5-coder-1.5b-instruct-q4_k_m.gguf -c 32768 --port 8585 -np 1 \u0026\n```  \n  *Note: To use a cloud API (like Mistral or OpenAI), simply ensure the corresponding environment variable (e.g., `${MISTRAL_API_KEY}`) is set.*  \n\n  3. **Start embedding** (this uses the configured local directory ./):  \n```\n./phenixcode-core embed\n```  \n  4. **Start** the main HTTP server and the UI: \n```\n./phenixcode-core serve --watch --interval 60\n./phenixcode-ui\n```  \n\n### How to build\n\nC++ 20 or newer is required.  \nnodejs v20 or newer is required.  \n\n```bash\n# clone the repository and cd into it.\n\n# Build both core and ui with a single command:\n\n# Build in Linux\n./package-lin.sh\n\n# Build in MacOS\n./package-mac.sh\n\n# Build in Windows\npackage.bat\n\n\n# To build either core or ui separately, use build_rel scripts\n\n# e.g. building core only\n./build_rel.sh\n\n# or building ui only\ncd ui/clients/webview\n./build_rel.sh\n```\n\n### CLI commands\n\nInitial full embed of all sources from settings.json  \n```./phenixcode-core --config settings.json embed```\n\nCheck for changes and update only what changed  \n```./phenixcode-core update```\n\nContinuous monitoring (checks every 60 seconds)  \n```./phenixcode-core watch --interval 60```\n\nReclaim space used by deleted index items  \n```./phenixcode-core compact```\n\nSearch nearest neighbours  \n```./phenixcode-core search \"how to optimize C++\" --top 10```\n\nChat with LLM  \n```./phenixcode-core chat```\n\nServe on a custom port with auto-update every N seconds  \n```./phenixcode-core serve --port 9000 --watch --interval 60```\n\nServe on the default port (8590) without auto-update (manual trigger via /update endpoint)  \n```./phenixcode-core serve```\n\nDefault admin password: `admin` — change it immediately using one of the methods below.  \nChange Password - Method 1: Direct  \n```./phenixcode-core reset-password --pass NewPassword456```\n\nChange Password - Method 2: Interactive (hides input)  \n```./phenixcode-core reset-password-interactive```\n\nCheck password status  \n```./phenixcode-core password-status```\n\n\n### Editing settings.json\n\nMethod 1:  \nEdit file `settings.json` to configure settings manually\n\nMethod 2:  \nUse dashboard GUI `phenixcode_admin` to start/stop add/remove projects for various codebases (recommended).\n\n![PhenixCode Admin Dashboard](media/dashboard1.png)\n\n\n### REST API endpoints\n\n```bash\n# Get list of API endpoints\ncurl -X GET http://localhost:8590/api\n\n# Health check\ncurl -X GET http://localhost:8590/api/health\n\n# Get document list\ncurl -X GET http://localhost:8590/api/documents\n\n# Get configuration parameters (full config)\ncurl -X GET http://localhost:8590/api/setup\n\n# Get available APIs (completion endpoints)\ncurl -X GET http://localhost:8590/api/settings\n\n# Get running instances (usually one instance per project codebase)\ncurl -X GET http://localhost:8590/api/instances\n\n# Get database statistics\ncurl -X GET http://localhost:8590/api/stats\n\n# Get metrics (JSON)\ncurl -X GET http://localhost:8590/api/metrics\n\n# Get Prometheus metrics\ncurl -X GET http://localhost:8590/metrics\n\n# Setup configuration (POST)\ncurl -X POST http://localhost:8080/api/setup \\\n  -H \"Authorization: Basic $(echo -n \"username:password\" | base64)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"embedding\": {...},\n    \"generation\": {...},\n    \"database\": {...},\n    \"chunking\": {...}\n  }'\n\n# Search\ncurl -X POST http://localhost:8590/api/search \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"optimize performance\", \"top_k\": 5}'\n\n# Generate embeddings (without storing)\ncurl -X POST http://localhost:8590/api/embed \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"text\": \"your text here\"}'\n\n# Add document\ncurl -X POST http://localhost:8080/api/documents \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"content\": \"your document content\",\n    \"source_id\": \"document_source_id\"\n  }'\n\n# Trigger a manual update\ncurl -X POST http://localhost:8080/api/update\n\n# Chat with optional context (streaming)\ncurl -X POST http://localhost:8080/api/chat \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"messages\": [\n      {\"role\": \"system\", \"content\": \"Keep it short.\"},\n      {\"role\": \"user\", \"content\": \"What is the capital of France?\"}\n    ],\n    \"sourceids\": [\n      \"../phenixcode-core/src/main.cpp\",\n      \"../phenixcode-core/include/settings.h\"\n    ],\n    \"attachments\": [\n      { \"filename\": \"filename1.cpp\", \"content\": \"..text file content 1..\"},\n      { \"filename\": \"filename2.cpp\", \"content\": \"..text file content 2..\"}\n    ],\n    \"temperature\": 0.2,\n    \"max_tokens\": 800,\n    \"targetapi\": \"xai\",\n    \"ctxratio\": 0.5,\n    \"attachedonly\": false\n  }'\n\n# Initiate server shutdown that was started with an app key e.g. ./phenixcode-core serve --appkey abc123\ncurl -X POST http://localhost:8590/api/shutdown \\\n  -H \"X-App-Key: abc123\" \\\n  -d '{}'  \n\n# Authenticate  \ncurl -X POST http://localhost:8080/api/authenticate \\\n  -H \"Authorization: Basic $(echo -n \"username:password\" | base64)\"\n\n  \n```\n","funding_links":[],"categories":["AI code assistants/search"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnesall%2Fphenixcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnesall%2Fphenixcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnesall%2Fphenixcode/lists"}