Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scampion committed Jan 24, 2025
1 parent 66e1f08 commit db34808
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 53 deletions.
132 changes: 98 additions & 34 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,118 @@
# Changelog


## [0.1.2] - 2025-01-23

### 🛠️ **Fixes**
- **JSON Handling**:
- Fixed JSON escaping by replacing manual handling with `jq` for proper character handling. (`024c6f0`)
- Sanitized `ACTIVITY_CONTENT` for JSON by escaping special characters. (`a6dc37d`)
- **CORS Improvements**:
- Added CORS preflight request handling in the gateway. (`f1d1d94`)
- Removed `no-cors` mode and enhanced CORS headers for proper response handling. (`c210d41`)
- **Code Cleanup**:
- Simplified parser assignment and removed redundant code in `chat.html`. (`1949cd2`)
- Simplified configuration handling and response filtering in the gateway. (`4d3dd85`)
- **Miscellaneous Fixes**:
- Various fixes applied. (`f81fa3e`)

### **Features**
- **Automation**:
- Added `activity4changelog.sh` script to automate changelog generation. (`11283a4`)
- **Chat Service Enhancements**:
- Added chat service with conversation management endpoints. (`a2409c0`)
- Delegated chat API handling to the admin module. (`1c74add`)
- Added default host and port configurations for chat and echo services. (`bfb6610`, `815cf9b`)
- **UI/UX Improvements**:
- Added a save button to the navbar for explicit conversation saving. (`fdc1b63`)
- Displayed individual conversation items in the sidebar with previews. (`d5691c5`)
- Made the navbar fixed and full-width with proper content spacing. (`ed9cc13`)
- Added Enter key message sending with Shift+Enter for new lines. (`569ed9c`)
- Added model selection dropdown to the chat interface. (`7d49b8b`)
- **API Enhancements**:
- Updated model selection to handle new API response format. (`7bab77f`)
- Added model-specific message parsers in `parsers.js`. (`3ae29f0`)
- Added `Authorization` header with bearer token to API requests. (`3477fb4`)
- Dynamically populated `model-select` from gateway endpoint. (`e3b5028`)
- **Configuration**:
- Handled root path requests by returning configuration in JSON format. (`e80b498`)
- Added early return for root and login paths with YAML config. (`e1fdf62`)

### 📚 **Documentation**
- Added chat interface documentation and navigation. (`11283a4`)

### 🔄 **Refactors**
- **Code Simplification**:
- Used composition to delegate common functionality to `HttpAdminApp`. (`a2408a8`)
- Simplified error messages in `chat.html`. (`113168e`)
- Simplified request handling and moved root path logic to response filter. (`0eece05`)
- **UI Refactoring**:
- Moved inline styles to external CSS and adjusted navbar layout. (`1456084`)
- Replaced navbar links with server URL input in `chat.html`. (`41c5eba`)

### 🧹 **Chores**
- Updated `proxy_pass` URL in `conf.yml` to use port 6193. (`159f612`)
- Added service declaration route for the `/` URI to display all available models. (`d1830be`)

### 🎨 **Styling**
- **UI Adjustments**:
- Adjusted `model-select` margin for left alignment. (`a997bbb`)
- Aligned `model-select` to the left in `input-form` and adjusted spacing. (`a6fcbcd`)
- Adjusted widths for `#model-select` and `#send-button` elements. (`ebdaf30`)
- Adjusted form element widths and spacing in `input-form`. (`701f135`)
- Adjusted navbar image margin and chat container alignment. (`29a7263`)
- **Color & Layout**:
- Updated chat interface colors for better readability. (`b23df74`)
- Commented out height calculation in CSS. (`689ee22`)

### **New Features & Enhancements**
- 🧠 **OpenAI API Support**: Added support for OpenAI API integration.
- Now you can interact with OpenAI models directly through the gateway!
- **OpenAI API Integration**:
- Added support for OpenAI API integration.
- Example endpoint: `/api.openai.com/v1/chat/completions`.
- Parser added for OpenAI token usage tracking.
- 📦 **Gzip Encoding Support**: Added gzip decoding for upstream responses.
- Handles gzip-encoded responses from upstream services seamlessly.
- **Gzip Encoding Support**:
- Added gzip decoding for upstream responses.
- Ensures efficient data transfer and processing.
- ⚙️ **Admin Service Configuration**: Added admin host/port configuration to server config.
- Admin service now uses configurable values instead of hardcoded ones.
- **Admin Service Configuration**:
- Added admin host/port configuration to server config.
- Improved flexibility for deployment environments.
- 🤖 **CI/CD Pipeline**: Set up GitHub Actions for continuous integration.
- **CI/CD Pipeline**:
- Set up GitHub Actions for continuous integration.
- Added workflows for building, testing, and releasing Rust binaries.
- Supports multiple platforms: Linux (x86_64, arm64) and macOS.
---

### 🛠️ **Bug Fixes & Improvements**
- 🔒 **Token Validation**: Improved token validation in the admin interface.
- **Token Validation**:
- Improved token validation in the admin interface.
- Tokens shorter than 32 characters are now rejected.
- Better error handling for invalid JSON requests.
- 📄 **Response Header Handling**: Fixed response header handling in the gateway.
- **Response Header Handling**:
- Fixed response header handling in the gateway.
- Removed hardcoded headers and improved content encoding management.
- Ensures proper handling of `Transfer-Encoding` and `Content-Length`.
- 🕵️ **PII Protection**: Enhanced PII (Personally Identifiable Information) detection.
- **PII Protection**:
- Enhanced PII (Personally Identifiable Information) detection.
- Added tests for long text inputs with PII.
- Improved handling of blacklisted words and confidential data.
- 📊 **Echo Service**: Renamed request counter for clarity.
- Changed `REQ_COUNTER` to `ECHO_REQ_COUNTER` for better readability.
---
- **Echo Service**:
- Renamed request counter for clarity (`REQ_COUNTER` to `ECHO_REQ_COUNTER`).

### 🧪 **Tests & Quality Assurance**
- 🧑‍💻 **Admin Interface Tests**: Added comprehensive tests for the admin interface.
- Covers token creation, deletion, and usage stats.
- Includes edge cases like invalid JSON and timeout handling.
- 📝 **Local Tests**: Added local tests for PII and long text handling.
- Ensures proper detection of PII in large inputs.
- Validates blacklisted word filtering.
- 🌐 **Remote Tests**: Expanded remote tests for Deepseek and OpenAI APIs.
- Added test cases for OpenAI API integration.
- Improved Deepseek API test coverage.
---
- **Admin Interface Tests**:
- Added comprehensive tests for token creation, deletion, and usage stats.
- **Local Tests**:
- Added local tests for PII and long text handling.
- **Remote Tests**:
- Expanded remote tests for Deepseek and OpenAI APIs.

### 📚 **Configuration & Documentation**
- 🖥️ **Config Updates**: Updated `conf.yml` with new admin host/port settings.
- Added `admin_host` and `admin_port` configurations.
- Improved proxy pass and model configurations.
- 📜 **Changelog Updates**: Updated the changelog with recent changes.
- **Config Updates**:
- Updated `conf.yml` with new admin host/port settings.
- **Changelog Updates**:
- Added details about new features, bug fixes, and tests.
---

### 🎉 **Miscellaneous**
- 📂 **File Renaming**: Renamed `changelog.md` to `CHANGELOG.md` for consistency.
- 🔄 **Dependency Updates**: Added `flate2` crate for gzip support.
- Renamed `changelog.md` to `CHANGELOG.md` for consistency.
- Added `flate2` crate for gzip support.

---


## [0.1.1] - 2025-01-23
Expand Down
19 changes: 5 additions & 14 deletions activity4changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,18 @@ ACTIVITY_CONTENT=$(cat "$OUTPUT_FILE" | \
tr -d '\000-\031' | \
jq -sR . | sed 's/^"\(.*\)"$/\1/')

curl -X POST "https://api.deepseek.com/v1/chat/completions" \


MESSAGE=$(curl -X POST "https://api.deepseek.com/v1/chat/completions" \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"model\": \"deepseek-chat\",
\"messages\": [
{\"role\": \"user\", \"content\": \"$DEEPSEEK_PROMPT\n\n$ACTIVITY_CONTENT\"}
]
}"

#
#MESSAGE=$(curl -X POST "https://api.deepseek.com/v1/chat/completions" \
# -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
# -H "Content-Type: application/json" \
# -d "{
# \"model\": \"deepseek-chat\",
# \"messages\": [
# {\"role\": \"user\", \"content\": \"$DEEPSEEK_PROMPT\n\n$ACTIVITY_CONTENT\"}
# ]
# }" | jq -r '.choices[0].message.content')
#
}" | jq -r '.choices[0].message.content')


echo $MESSAGE | pbcopy

Expand Down
74 changes: 74 additions & 0 deletions docs/chat-interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Chat Interface

The Burgonet Gateway provides a web-based chat interface for interacting with supported LLM models.

![Chat Interface](images/chat-interface.png)

## Features

- 🗨️ **Conversation History**: View and manage past conversations
- 🤖 **Model Selection**: Choose from available LLM models
- 🔑 **Token Management**: Set and save API tokens
- 🌐 **Server Configuration**: Configure gateway URL
- 📝 **Message Formatting**: Supports markdown and code blocks
- ⏱️ **Real-time Responses**: Streamed responses for fast interaction

## Accessing the Chat Interface

The chat interface is available at:

```
http://<chat_host>:<chat_port>
```

Default values:
- Host: `127.0.0.1`
- Port: `6190`

## Interface Components

1. **Navigation Bar**
- Gateway URL configuration
- API Token input
- Save button

2. **Sidebar**
- New Chat button
- Conversation history list

3. **Chat Window**
- Message display area
- User and assistant messages

4. **Input Area**
- Model selection dropdown
- Message input field
- Send button

## Configuration

The chat interface can be configured in `conf.yml`:

```yaml
chat_host: 127.0.0.1 # Host to serve chat interface
chat_port: 6190 # Port for chat interface
```
## Keyboard Shortcuts
- **Enter**: Send message (without shift)
- **Shift+Enter**: New line in message input
- **Ctrl+Enter**: Send message (alternative)
- **Esc**: Clear message input
## Troubleshooting
**Issue**: Chat interface not loading
- Verify chat service is running
- Check firewall settings for chat port
- Confirm correct gateway URL in navigation bar
**Issue**: Messages not sending
- Verify API token is valid
- Check model selection
- Confirm gateway is running and accessible
Binary file added docs/images/chat-interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions docs/technical.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

Burgonet Gateway uses several ports for different services:

| Port | Service | Description |
|------|------------------------|-----------------------------------------------------------------------------|
| 6189 | Admin Service | Provides web UI and API for configuration and monitoring |
| 6191 | Main Gateway Service | Handles all API requests and routing (default) |
| 6192 | Prometheus Metrics | Exposes monitoring metrics for scraping |
| Port | Service | Description |
|------|----------------------|----------------------------------------------------------|
| 6189 | Admin Service | Provides web UI and API for configuration and monitoring |
| 6190 | Chat Service | Chat web UI with local storage |
| 6191 | Main Gateway Service | Handles all API requests and routing (default) |
| 6192 | Prometheus Metrics | Exposes monitoring metrics for scraping |
| 6193 | Echo Service | Echo used to configure and tests |

These ports can be configured in the `conf.yml` file:

Expand Down

0 comments on commit db34808

Please sign in to comment.