feat(llm): add Requesty provider (OpenAI-compatible unified API) - #140
Open
Thibaultjaigu wants to merge 1 commit into
Open
Thibaultjaigu wants to merge 1 commit into
Thibaultjaigu wants to merge 1 commit into
Conversation
Mirrors the OpenRouter provider: raw fetch against https://router.requesty.ai/v1/chat/completions, LLM_API_KEY for auth, default model openai/gpt-4o-mini. Wired into createLLMProvider, documented in README/.env.example, with unit + gated integration tests. Signed-off-by: Thibault Jaigu <thibault.jaigu@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Crucix supports one unified-API router (OpenRouter). Users who already route their LLM traffic through Requesty (https://requesty.ai, one OpenAI-compatible key across OpenAI, Anthropic, Google, DeepSeek, etc., with SOC2/GDPR and an EU endpoint) currently can't point the LLM layer at it without editing source.
Change
Adds
requestyas a 9th LLM provider, mirroringlib/llm/openrouter.mjsline for line:lib/llm/requesty.mjs:RequestyProvider extends LLMProvider, rawfetch(no SDK) againsthttps://router.requesty.ai/v1/chat/completions,LLM_API_KEYfor auth, default modelopenai/gpt-4o-mini, sameHTTP-Referer/X-Titleheaders, same timeout/usage/error shape.lib/llm/index.mjs: import, export, andcase "requesty"increateLLMProvider.README.md,.env.example,crucix.config.mjs: provider lists and default-model table.test/llm-requesty.test.mjs(unit, mocked fetch) andtest/llm-requesty-integration.test.mjs(gated onLLM_PROVIDER=requesty+LLM_API_KEY, like the OpenRouter one).No changes to existing providers or config behaviour; LLM failures still degrade to the rule-based engine.
User-facing impact
LLM_PROVIDER=requesty+LLM_API_KEY=<key>enables AI trade ideas / alert evaluation through Requesty;LLM_MODELaccepts anyvendor/modelid from its catalog.Testing
node --test test/llm-requesty.test.mjs test/llm-openrouter.test.mjs→ 13/13 pass.Integration test run live with a real key (
LLM_PROVIDER=requesty) → 2/2 pass.Manual:
createLLMProvider({provider:"requesty",...}).complete(...)returned"hello from requesty"fromgpt-4o-mini-2024-07-18with usage populated.I tested the changed path locally
Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.