|
2 | 2 |
|
3 | 3 | [](https://github.com/stacklok/codegate/actions/workflows/ci.yml) |
4 | 4 |
|
5 | | -A configurable Generative AI gateway, protecting developers from the dangers of AI. |
| 5 | +Codegate is a local gateway that makes AI coding assistants safer. Acting as a security checkpoint, Codegate ensures AI-generated recommendations adhere to best practices, while safeguarding your code's integrity, and protecting your individual privacy. With Codegate, you can confidently leverage AI in your development workflow without compromising security or control. |
6 | 6 |
|
7 | | -## Features |
| 7 | +## ✨ Why Codegate? |
8 | 8 |
|
9 | | -- Secrets exflitration prevention |
10 | | -- Secure Coding recommendations |
11 | | -- Preventing AI from recommending deprecated and / or malicious libraries |
| 9 | +In today's world where AI coding assistants are becoming ubiquitous, security can't be an afterthought. Codegate sits between you and AI, actively protecting your development process by: |
12 | 10 |
|
| 11 | +- 🔒 Preventing accidental exposure of secrets and sensitive data |
| 12 | +- 🛡️ Ensuring AI suggestions follow secure coding practices |
| 13 | +- ⚠️ Blocking recommendations of known malicious or deprecated libraries |
| 14 | +- 🔍 Providing real-time security analysis of AI suggestions |
13 | 15 |
|
14 | | -### Installation |
| 16 | +## 🌟 Features |
15 | 17 |
|
16 | | -#### Requirements |
| 18 | +### Supported AI Providers |
| 19 | +Codegate works seamlessly with leading AI providers: |
| 20 | +- 🤖 Anthropic (Claude) |
| 21 | +- 🧠 OpenAI |
| 22 | +- ⚡ vLLM |
| 23 | +- 💻 Local LLMs (run AI completely offline!) |
| 24 | +- 🔮 Many more on the way! |
17 | 25 |
|
18 | | -- [Docker](https://docs.docker.com/get-docker/) |
19 | | -- [Docker Compose](https://docs.docker.com/compose/install/) |
20 | | -- [jq](https://stedolan.github.io/jq/download/) |
21 | | -- [vscode](https://code.visualstudio.com/download) |
| 26 | +### Run AI Your Way |
| 27 | +- 🌐 Cloud Providers: Use leading AI services like OpenAI and Anthropic |
| 28 | +- 🏠 Local LLMs: Keep everything offline with local model support |
| 29 | +- 🔄 Hybrid Mode: Mix and match cloud and local providers as needed |
22 | 30 |
|
23 | | -#### Steps |
| 31 | +### AI Coding Assistants |
| 32 | +We're starting with Continue VSCode extension support, with many more AI coding assistants coming soon! |
24 | 33 |
|
25 | | -Download the installation script docker-compose.yml |
| 34 | +### Privacy First |
| 35 | +Unlike E.T., your code never phones home! 🛸 Codegate is designed with privacy at its core: |
| 36 | +- 🏠 Everything stays on your machine |
| 37 | +- 🚫 No external data collection |
| 38 | +- 🔐 No calling home or telemetry |
| 39 | +- 💪 Complete control over your data |
26 | 40 |
|
27 | | -Run the installation script |
| 41 | +## 🚀 Quick Start |
| 42 | + |
| 43 | +### Prerequisites |
| 44 | + |
| 45 | +Make sure you have these tools installed: |
| 46 | + |
| 47 | +- 🐳 [Docker](https://docs.docker.com/get-docker/) |
| 48 | +- 🔧 [Docker Compose](https://docs.docker.com/compose/install/) |
| 49 | +- 🛠️ [jq](https://stedolan.github.io/jq/download/) |
| 50 | +- 💻 [VSCode](https://code.visualstudio.com/download) |
| 51 | + |
| 52 | +### One-Command Setup |
28 | 53 |
|
29 | 54 | ```bash |
30 | 55 | chmod +x install.sh && ./install.sh |
31 | 56 | ``` |
32 | 57 |
|
33 | | -The script will download the Continue VSCode extension, create |
34 | | -a configuration file. The script will also create a docker-compose.yml file and start the services. |
| 58 | +This script will: |
| 59 | +1. Install the Continue VSCode extension |
| 60 | +2. Set up your configuration |
| 61 | +3. Create and start necessary Docker services |
35 | 62 |
|
36 | | -### Usage |
| 63 | +## 🎯 Usage |
37 | 64 |
|
38 | | -Tap the Continue button in the VSCode editor to start the service |
39 | | -to bring up a chat window. The chat window will be displayed in the |
40 | | -VSCode editor. |
| 65 | +### VSCode Integration with Continue |
41 | 66 |
|
42 | | - |
| 67 | +Simply tap the Continue button in your VSCode editor to start chatting with your AI assistant - now protected by Codegate! |
43 | 68 |
|
44 | | -## Usage |
| 69 | + |
45 | 70 |
|
46 | | -### Basic Usage (Manual) |
47 | | - |
48 | | -Start the server with default settings: |
| 71 | +### Manual Configuration |
49 | 72 |
|
| 73 | +#### Basic Server Start |
50 | 74 | ```bash |
51 | 75 | codegate serve |
52 | 76 | ``` |
53 | 77 |
|
54 | | -### Custom Configuration |
55 | | - |
56 | | -Start with custom settings: |
57 | | - |
| 78 | +#### Custom Settings |
58 | 79 | ```bash |
59 | 80 | codegate serve --port 8989 --host localhost --log-level DEBUG |
60 | 81 | ``` |
61 | 82 |
|
62 | | -### Configuration File |
63 | | - |
64 | | -Use a YAML configuration file: |
65 | | - |
66 | | -```bash |
67 | | -codegate serve --config my_config.yaml |
68 | | -``` |
69 | | - |
70 | | -Example `config.yaml`: |
71 | | - |
| 83 | +#### Using Config File |
| 84 | +Create a `config.yaml`: |
72 | 85 | ```yaml |
73 | 86 | port: 8989 |
74 | 87 | host: "localhost" |
75 | 88 | log_level: "DEBUG" |
76 | 89 | ``` |
77 | 90 |
|
78 | | -### Environment Variables |
79 | | -
|
80 | | -Configure using environment variables: |
| 91 | +Then run: |
| 92 | +```bash |
| 93 | +codegate serve --config config.yaml |
| 94 | +``` |
81 | 95 |
|
| 96 | +#### Environment Variables |
82 | 97 | ```bash |
83 | 98 | export CODEGATE_APP_PORT=8989 |
84 | 99 | export CODEGATE_APP_HOST=localhost |
85 | 100 | export CODEGATE_APP_LOG_LEVEL=DEBUG |
86 | 101 | codegate serve |
87 | 102 | ``` |
88 | 103 |
|
89 | | -## Development |
90 | | - |
91 | | -### Setup |
| 104 | +## 🛠️ Development |
92 | 105 |
|
| 106 | +### Local Setup |
93 | 107 | ```bash |
94 | | -# Clone the repository |
| 108 | +# Get the code |
95 | 109 | git clone https://github.com/stacklok/codegate.git |
96 | 110 | cd codegate |
97 | 111 |
|
98 | | -# Create and activate a virtual environment |
| 112 | +# Set up virtual environment |
99 | 113 | python -m venv venv |
100 | 114 | source venv/bin/activate # On Windows: venv\Scripts\activate |
101 | 115 |
|
102 | | -# Install development dependencies |
| 116 | +# Install dev dependencies |
103 | 117 | pip install -e ".[dev]" |
104 | 118 | ``` |
105 | 119 |
|
106 | 120 | ### Testing |
107 | | - |
108 | 121 | ```bash |
109 | 122 | pytest |
110 | 123 | ``` |
| 124 | + |
| 125 | +## 🐳 Docker Deployment |
| 126 | + |
| 127 | +### Build the Image |
| 128 | +```bash |
| 129 | +make image-build |
| 130 | +``` |
| 131 | + |
| 132 | +### Run the Container |
| 133 | +```bash |
| 134 | +# Basic usage |
| 135 | +docker run -p 8989:8989 codegate:latest |
| 136 | + |
| 137 | +# With persistent data |
| 138 | +docker run -p 8989:8989 -v /path/to/volume:/app/weaviate_data codegate:latest |
| 139 | +``` |
| 140 | + |
| 141 | +## 🤝 Contributing |
| 142 | + |
| 143 | +We welcome contributions! Whether it's bug reports, feature requests, or code contributions, please feel free to contribute to making Codegate better. |
| 144 | + |
| 145 | +## 📜 License |
| 146 | + |
| 147 | +This project is licensed under the terms specified in the [LICENSE](LICENSE) file. |
0 commit comments