Conversation
1b66bb2 to
188241d
Compare
Greptile SummaryThis PR adds an Confidence Score: 4/5Safe to merge; the current generated Models.php is correct and the adapter logic is sound — the main fix needed is a validation guard in the sync script. The adapter and test code are well-implemented with no runtime issues in the current state. The one targeted fix is adding a guard in sync-openrouter-models.php so future runs cannot silently produce a Models.php with an unresolvable constant reference. scripts/sync-openrouter-models.php — hardcoded DEFAULT_MODEL reference and toConstantName double-prefix bug. Important Files Changed
Reviews (1): Last reviewed commit: "feat: add OpenRouter adapter" | Re-trigger Greptile |
188241d to
b573c1b
Compare
Adds OpenRouter as a new AI provider, extending the OpenAI adapter with custom HTTP headers (HTTP-Referer, X-Title) and provider-prefixed model ID normalization. Includes a PHP sync script to generate model constants from the live OpenRouter API catalog.
b573c1b to
8df9473
Compare
2ced0ce to
a3858ec
Compare
Summary
OpenRouteradapter extendingOpenAIwith support for OpenRouter's API endpoint, custom headers (HTTP-Referer,X-Title), and provider-prefixed model ID normalizationOpenRouter\Modelsclass with named constants for major providers (OpenAI, Anthropic, Google, Meta, DeepSeek, Mistral, xAI) and the full 346-model catalogscripts/sync-openrouter-models.phpto regenerate model constants from the live OpenRouter APIOpenAIadapter to extractcreateClient()andnormalizeModelForCompatibilityChecks()for clean subclassingTest plan
OpenRouteradapter constructs with default model and endpointmeta-llama/llama-3.3-70b-instruct) are acceptedConversationOpenRouterTestwithLLM_KEY_OPENROUTERset to confirm live API connectivityphp scripts/sync-openrouter-models.phpto verify model sync generates valid PHP