gptproxy  by xicilion

API proxy for OpenAI using GitLab API key

created 2 years ago
253 stars

Top 99.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a proxy server for OpenAI's API, specifically designed to leverage GitLab API keys for authentication and authorization. It targets developers working with the fibjs framework, offering a development assistant that answers questions about fibjs based on its documentation. The primary benefit is enabling secure and controlled access to OpenAI's services using existing GitLab infrastructure.

How It Works

The server, built with fibjs, acts as an intermediary between clients and the OpenAI API. It intercepts requests, validates GitLab API keys via GitLab's API, and caches valid tokens. For chat completion requests containing "fibjs," it retrieves relevant documentation from a local SQLite database using embeddings generated by OpenAI's embedding API. This retrieved information is then prepended to the prompt sent to OpenAI, allowing the model to answer fibjs-specific questions contextually.

Quick Start & Requirements

  • Install and run using fibjs: fibjs server.js
  • Prerequisites: fibjs runtime, OpenAI API key, GitLab API key, cert.pem and key.pem for SSL.
  • Requires a local SQLite database populated with fibjs documentation.
  • Official documentation and demo links are not provided in the README.

Highlighted Details

  • Proxies OpenAI API requests using GitLab API keys for authentication.
  • Implements token caching with a 1-minute expiration.
  • Utilizes OpenAI embeddings for semantic search within a local SQLite database.
  • Answers fibjs-specific questions by augmenting prompts with retrieved documentation.

Maintenance & Community

  • The project is maintained by xicilion.
  • No community links (Discord, Slack) or roadmap are mentioned.

Licensing & Compatibility

  • The README does not specify a license.
  • Compatibility for commercial use or closed-source linking is not detailed.

Limitations & Caveats

The project is described as a development assistant and may not be suitable for production environments without further hardening. The README does not detail error handling beyond basic status code checks, and the security implications of proxying API keys require careful consideration.

Health Check
Last commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
7 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.