Class NaruOpenRouterProvider
java.lang.Object
net.thevpc.naru.api.model.AbstractNaruModelProvider
net.thevpc.naru.ext.models.openapi.AbstractOpenAICompatProvider
net.thevpc.naru.ext.models.openrouter.NaruOpenRouterProvider
- All Implemented Interfaces:
NaruModelProvider,net.thevpc.nuts.spi.NComponent
OpenRouter provider — one API key gives access to hundreds of models,
including a rotating set of
:free variants.
Endpoint: POST {baseUrl}/chat/completions
Default baseUrl: https://openrouter.ai/api/v1
-
Field Summary
Fields inherited from class net.thevpc.naru.ext.models.openapi.AbstractOpenAICompatProvider
protocols -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbaseUrl(NaruSession session) Fallback base url when<name>.urlconfig is not set.protected NaruModelProtocolcreateProtocol(NaruModelConfig model, NaruModelCapabilities capabilities, NaruSession session) findModelIds(NaruSession session) resolveCapabilities(String modelName, NaruSession session) Statically maps capabilities since cloud-hosted capabilities cannot be polled natively.Methods inherited from class net.thevpc.naru.ext.models.openapi.AbstractOpenAICompatProvider
chatPath, connectTimeout, fetchLiveModelIds, findModelIdsWithLiveFallback, getProtocol, isApiKeySet, isReachable, modelsPath, readTimeoutMethods inherited from class net.thevpc.naru.api.model.AbstractNaruModelProvider
apiKey, defaultEnvKey, getParam, getParamNames, getSecureParam, isEnabled, name, onParamChanged, setEnabled, setParamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.thevpc.naru.api.model.NaruModelProvider
installModel, isAvailable, isSupportedInstallModel, isSupportedPsModel, isSupportedUninstallModel, isSupportedUnloadModel, psModel, uninstallModel, unloadModel
-
Constructor Details
-
NaruOpenRouterProvider
public NaruOpenRouterProvider()
-
-
Method Details
-
createProtocol
protected NaruModelProtocol createProtocol(NaruModelConfig model, NaruModelCapabilities capabilities, NaruSession session) - Overrides:
createProtocolin classAbstractOpenAICompatProvider
-
findModelIds
- Specified by:
findModelIdsin interfaceNaruModelProvider- Overrides:
findModelIdsin classAbstractOpenAICompatProvider
-
baseUrl
Description copied from class:AbstractOpenAICompatProviderFallback base url when<name>.urlconfig is not set.- Specified by:
baseUrlin classAbstractOpenAICompatProvider
-
resolveCapabilities
Description copied from class:AbstractOpenAICompatProviderStatically maps capabilities since cloud-hosted capabilities cannot be polled natively.- Specified by:
resolveCapabilitiesin classAbstractOpenAICompatProvider
-