Skip to content

Matching og#1

Open
ryanhellyer wants to merge 5 commits into
masterfrom
matching_og
Open

Matching og#1
ryanhellyer wants to merge 5 commits into
masterfrom
matching_og

Conversation

@ryanhellyer
Copy link
Copy Markdown
Owner

Summary

Add multi-provider AI support to gitmeh, refactor commit message generation into a dedicated service, and introduce an OpenAI-compatible /v1/chat/completions hosted API endpoint.

Changes

  • Multi-provider support: Extract GitmehCommitMessageGenerator service from the controller. Supports configurable providers (OpenRouter, OpenAI, Anthropic, Groq, Mistral, Ollama, xAI, opencode) with per-provider defaults for base URL, API key, and model. Adds default_provider config key and request-level provider field.
  • OpenAI-compatible hosted API (/v1/chat/completions): New GitmehChatCompletionsController exposing an OpenAI-shaped JSON endpoint. Middleware added for: method restriction (POST only, 405 for others), JSON body size limiting (configurable, 413 on exceed), optional Bearer auth (custom client keys forwarded to upstream provider). Shares daily rate limits with the legacy plain-text endpoint.
  • Fallback models: Request-level fallback_models array — if the primary model fails with a context-length or retryable error, subsequent models are tried automatically with exponential backoff.
  • Config overhaul: Migrated services.openrouter.* settings into gitmeh.* namespace. New config keys: prompt, timeout, hosted_bearer_token, max_json_request_bytes, chat_inference_timeout_seconds.
  • Shell script update: gitmeh.sh now uses OPENAI_API_KEY / OPENAI_MODEL (generalized from OpenRouter-specific vars).
  • Tests: Comprehensive feature test suite for the new /v1/chat/completions endpoint covering success, errors, auth, fallback models, provider selection, rate limit sharing, oversized bodies, and invalid inputs.
  • Verification script: scripts/verify-hosted-api.sh to smoke-test the deployed endpoint.
  • Documentation: docs/hosted-api-migration-instructions.md with the server-side implementation contract.
  • Default prompt: Updated to enforce Conventional Commits format.
  • readme: Updated usage and testing instructions.

…ey forwarding

- Support multiple upstream providers (OpenAI, Anthropic, Groq, Mistral, Ollama, XAI, etc.)
- Add fallback_models parameter with exponential backoff retry logic
- Forward client-provided API keys for authenticated requests
- Replace Laravel AI agent with direct HTTP client implementation
- Update README with authentication modes and provider selection
Update the DEFAULT_PROMPT constant to explicitly request Conventional Commits format and restrict output to only the commit message without analysis or preamble.
… and provider-driven defaults; update config, scripts, and tests
@ryanhellyer ryanhellyer self-assigned this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant