sync: update from private repo (22cd034)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-09 06:02:32 +00:00
parent 3848b5efd7
commit 8ac98d2630
13 changed files with 589 additions and 37 deletions
@@ -38,9 +38,28 @@ interface GatewayBackend {
endpoint?: string;
model?: string;
maxSlots?: number;
/** Performance tiers (Roles) this backend serves. Empty = serves all. */
roles?: string[];
apiKey?: string;
}
/** Format a roles array for the comma-separated text input. */
function rolesToInput(roles: string[] | undefined): string {
return Array.isArray(roles) ? roles.join(', ') : '';
}
/**
* Parse the comma-separated roles input into a deduped string array, or
* `undefined` when blank (= backend serves every role, migration-safe).
*/
function parseRolesInput(v: string): string[] | undefined {
const parts = v
.split(',')
.map(s => s.trim())
.filter(s => s.length > 0);
return parts.length > 0 ? [...new Set(parts)] : undefined;
}
interface GatewayConfigShape {
enabled?: boolean;
listenPort?: number;
@@ -246,7 +265,7 @@ export function GatewayServerForm({ config, onChange }: SectionFormProps) {
</button>
</div>
<HelpText>
llama-server / Ollama / vLLM Gateway <code>request.model</code> <code>model</code> busy backend <br/>
llama-server / Ollama / vLLM Gateway worker <strong>role</strong> backend (<code>roles</code> backend role )role backend <code>request.model</code> = <code>id</code>/<code>model</code> <br/>
<strong>api_key </strong>: <code>config.yaml</code> <code>${'${VAR}'}</code> env var literal env <code>config.yaml</code>
</HelpText>
{backends.length === 0 ? (
@@ -291,6 +310,17 @@ export function GatewayServerForm({ config, onChange }: SectionFormProps) {
placeholder="1"
/>
</div>
<div className="col-span-2">
<FieldLabel>roles ()</FieldLabel>
<FieldInput
value={rolesToInput(b.roles)}
onChange={v => updateBackend(i, 'roles', parseRolesInput(v))}
placeholder="quality, auto (空欄=全ロール)"
/>
<HelpText>
backend (<code>auto</code> / <code>fast</code> / <code>quality</code> / <code>reflection</code>) worker role routing key Gateway role backend <strong></strong> () model GPU role
</HelpText>
</div>
<div>
<FieldLabel>api_key ()</FieldLabel>
<FieldInput