moonpalace  by MoonshotAI

LLM API debugging proxy

Created 1 year ago
253 stars

Top 99.3% on SourcePulse

GitHubView on GitHub
Project Summary

MoonPalace is an API debugging tool from Moonshot AI designed for developers interacting with the Kimi LLM API. It acts as a local proxy, capturing, inspecting, and exporting API requests and responses to simplify troubleshooting during development and facilitate model improvement through structured feedback.

How It Works

MoonPalace operates as a local HTTP proxy. Developers redirect their application's base_url to MoonPalace (e.g., http://localhost:9988/v1). The tool intercepts all Kimi API calls, logging comprehensive details including network errors, and storing them in a local SQLite database. This enables efficient searching, inspection, and export of requests using identifiers like request_id or chatcmpl_id.

Quick Start & Requirements

Installation is via go install github.com/MoonshotAI/moonpalace@latest or downloading pre-compiled binaries. Run moonpalace start --port <PORT> (default 9988), then update your application's base_url to http://127.0.0.1:<PORT>/v1. A default API key can be set with --key.

Highlighted Details

  • Cross-Platform: Supports macOS, Windows, and Linux.
  • Comprehensive Logging: Captures full requests, responses, and network errors.
  • Advanced Search & Export: Retrieve and export requests by request_id, chatcmpl_id, or id, with options for tagging and categorizing (good/bad cases).
  • Auto-Caching: Caches /chat/completions responses based on size, TTL, and cleanup policies.
  • Output Quality Monitoring: Detects content truncation and repetitive output, offering suggestions and interruption capabilities to save costs.
  • Connection Stability: --force-stream option converts non-streaming requests to streaming to mitigate proxy-induced connection errors.
  • Predicate Filtering: Advanced filtering of captured requests using expressions on JSON fields.

Maintenance & Community

Developed by Moonshot AI (月之暗面). No specific community channels, active maintainer details, sponsorships, or roadmap links were found in the provided README.

Licensing & Compatibility

The specific open-source license is not stated in the README. Compatibility for commercial use or closed-source linking is undetermined.

Limitations & Caveats

Future development includes using Kimi for debugging, enhanced retrieval, batch export, auto-reporting, API mocking, and a web UI. Repeat content detection is most effective with streaming output. The license remains unknown.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Ishaan Jaffer Ishaan Jaffer(Cofounder of LiteLLM), and
10 more.

ogx by ogx-ai

0.1%
8k
Composable building blocks for Llama apps
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.