implement generic provider for vendor-agnostic passthrough (#3175)

This commit is contained in:
woody
2025-12-03 09:52:47 +08:00
committed by GitHub
parent ae0bb41885
commit 116e7c6904
6 changed files with 360 additions and 0 deletions

View File

@@ -197,6 +197,18 @@ For Ollama, the corresponding `type` is `ollama`. Its unique configuration field
| `ollamaServerHost` | string | Required | - | The host address of the Ollama server. |
| `ollamaServerPort` | number | Required | - | The port number of the Ollama server, defaults to 11434. |
#### Generic
For a vendor-agnostic passthrough, set the provider `type` to `generic`. Requests are forwarded without path remapping, while still benefiting from the shared header/basePath utilities.
| Name | Data Type | Requirement | Default | Description |
|----------------|-----------|-------------|---------|----------------------------------------------------------------------------------------------------------|
| `genericHost` | string | Optional | - | Overrides the upstream `Host` header. Use it to route traffic to a specific backend domain for generic proxying. |
- When `apiTokens` are configured, the Generic provider injects `Authorization: Bearer <token>` automatically.
- `firstByteTimeout` applies to any request whose body sets `stream: true`, ensuring consistent streaming behavior even without capability definitions.
- `basePath` and `basePathHandling` remain available to strip or prepend prefixes before forwarding.
#### Hunyuan
For Hunyuan, the corresponding `type` is `hunyuan`. Its unique configuration fields are: