pixiu-llm-gateway
Creates and validates dubbo-go-pixiu LLM gateway conf.yaml. Use for LLM proxy/tokenizer/kvcache filters, llm_meta, vLLM, LMCache, retry/fallback, or Nacos LLM discovery. Do not use for MCP gateway config.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-13
- Stars
- ★ 568
- Forks
- 195
01 前言 Front Matter
- name
- pixiu-llm-gateway
- description
- Creates and validates dubbo-go-pixiu LLM gateway conf.yaml. Use for LLM proxy/tokenizer/kvcache filters, llm_meta, vLLM, LMCache, retry/fallback, or Nacos LLM discovery. Do not use for MCP gateway config.
02 资源文件 1
- 参考文档agents/openai.yaml141 B
03 SKILL.md 正文
pixiu-llm-gateway
Purpose
Generate a complete or embeddable LLM gateway conf.yaml that configures Pixiu as a multi-provider HTTP proxy.
When to use
-
Use when:
- Generating or fixing Pixiu LLM gateway
conf.yaml, including LLM proxy/tokenizer/kvcache,llm_meta, retry/fallback, vLLM/LMCache, or Nacos LLM discovery.
- Generating or fixing Pixiu LLM gateway
-
Do not use for:
- MCP gateway, HTTP-to-Dubbo routes, or implementing new LLM-related filters.
Inputs
<HARD-GATE> Do not generate YAML, write code, create files, or take any implementation action until the user has provided all required inputs. This is a first principle.
If any required input is missing, this turn must only ask for the missing fields in the current input group; do not generate examples, defaults, YAML, code, or final output.
Even if configuration information seems inferable, obvious, or implied by context, you must still ask the user to confirm it. Do not proceed until the user confirms it. </HARD-GATE>
-
Choose upstream mode (required):
- Required:
upstream_mode:staticorregistry
- Required:
-
listener(required):- Defaults:
address.socket_address.address: 0.0.0.0address.socket_address.port: 8888
- Defaults:
-
route_config(required):- Defaults:
routes[].match.prefix: /v1routes[].route.cluster: llm
- Defaults:
-
dgp.filter.llm.proxy(required):- Defaults:
config.scheme: http(usehttpswhen the upstream is an HTTPS endpoint)config.timeout: 60sconfig.maxIdleConns: 100config.maxIdleConnsPerHost: 100config.maxConnsPerHost: 100
- Defaults:
-
Static upstream (required when
upstream_mode: static):- Required:
endpoints[].IDendpoints[].socket_address.addressorendpoints[].socket_address.domainsendpoints[].socket_address.port
- Optional:
endpoints[].llm_meta.providerendpoints[].llm_meta.api_keyendpoints[].llm_meta.retry_policy.config
- Defaults:
clusters[].name: llmclusters[].lb_policy: RoundRobinendpoints[].llm_meta.retry_policy.name: NoRetryendpoints[].llm_meta.fallback: falseendpoints[].llm_meta.health_check_interval: 5000
- Required:
-
Registry upstream (required when
upstream_mode: registry):- Required:
registries.nacos.address
- Optional:
registries.nacos.groupregistries.nacos.namespaceregistries.nacos.usernameregistries.nacos.password
- Defaults:
adapters[].id: llm-registryadapters[].name: dgp.adapter.llmregistrycenterregistries.nacos.protocol: nacosregistries.nacos.timeout: 5sregistries.nacos.group: DEFAULT_GROUP
- Required:
-
dgp.filter.llm.tokenizer(optional):- Defaults:
config.log_to_console: false
- Defaults:
-
dgp.filter.ai.kvcache(optional):- Required:
config.enabled: true(must be set explicitly when enabling kvcache)config.vllm_endpointconfig.lmcache_endpoint
- Optional:
config.default_modelconfig.token_cacheconfig.cache_strategy
- Defaults:
config.request_timeout: 2sconfig.lookup_routing_timeout: 50msconfig.hot_window: 5mconfig.hot_max_records: 300config.max_idle_conns: 100config.max_idle_conns_per_host: 100config.max_conns_per_host: 100config.retry.max_attempts: 3config.retry.base_backoff: 100msconfig.retry.max_backoff: 2sconfig.circuit_breaker.failure_threshold: 5config.circuit_breaker.recovery_timeout: 10sconfig.circuit_breaker.half_open_max_calls: 2
- Required:
Workflow
- Check required Inputs first:
- Read existing config and already provided user information first; do not ask again for information already present or stated.
- Ask one
Inputsgroup at a time. Each time, output only that group's required fields, with a short explanation after each field. - If the current group's required fields are incomplete, ask only for the missing fields and do not move to the next group.
- After the current group's required fields are complete, ask whether to fill that group's optional fields; if yes, list those optional fields with short explanations.
- After optional fields are skipped or completed, apply that group's defaults and output default-value information; defaults must not override existing config or user input.
- Read current source before generating YAML:
pkg/common/constant/key.go.pkg/filter/llm/proxy/filter.go.pkg/filter/llm/tokenizer/tokenizer.go.pkg/filter/ai/kvcache/config.goandpkg/filter/ai/kvcache/handlers.go.pkg/model/llm.go,pkg/model/cluster.go, andpkg/model/base.go.
- Choose static or registry path by
upstream_mode: static usesstatic_resources.clusters[]; registry uses the LLM registry adapter. - Generate listener, route, and filters: use HCM to carry the LLM route and HTTP filters; add
dgp.filter.ai.kvcache, tokenizer, anddgp.filter.llm.proxyas needed. - Generate LLM upstream: static endpoints go under
socket_addressandllm_meta; ensure the LLM cluster does not mix in ordinary HTTP endpoints.
Output format
- Show the relevant YAML fragments.
Validation
- Verify LLM filter-chain order:
dgp.filter.ai.kvcache->dgp.filter.llm.tokenizer->dgp.filter.llm.proxy; ignore missing filters within this order chain. - Verify
schemeis underdgp.filter.llm.proxy.config, not under an endpoint;socket_address.domainscontains host names only, such asapi.openai.com, not full URLs or paths. - When KV cache is enabled, verify the LMCache-side
instance_idexactly matches the Pixiu endpointID.
Examples
Complete LLM route example (conf.yaml):
static_resources:
listeners:
- name: net/http
protocol_type: HTTP
address:
socket_address:
address: 0.0.0.0
port: 8888
filter_chains:
filters:
- name: dgp.filter.httpconnectionmanager
config:
route_config:
routes:
- match:
prefix: /v1
route:
cluster: llm
http_filters:
- name: dgp.filter.ai.kvcache
config:
enabled: true
vllm_endpoint: "http://127.0.0.1:8000"
lmcache_endpoint: "http://127.0.0.1:9000"
default_model: "Qwen2.5-3B-Instruct"
request_timeout: "2s"
lookup_routing_timeout: "50ms"
hot_window: "5m"
hot_max_records: 300
hot_max_keys: 1000
max_idle_conns: 100
max_idle_conns_per_host: 100
max_conns_per_host: 100
token_cache:
enabled: true
max_size: 1024
ttl: "10m"
cache_strategy:
enable_compression: true
enable_pinning: true
enable_eviction: true
memory_threshold: 0.85
hot_content_threshold: 10
load_threshold: 0.7
pin_instance_id: "vllm-instance-1"
pin_location: "LocalCPUBackend"
compress_instance_id: "vllm-instance-1"
compress_location: "LocalCPUBackend"
compress_method: "zstd"
evict_instance_id: "vllm-instance-1"
circuit_breaker:
failure_threshold: 5
recovery_timeout: "10s"
half_open_max_calls: 2
retry:
max_attempts: 3
base_backoff: "100ms"
max_backoff: "2s"
- name: dgp.filter.llm.tokenizer
config:
log_to_console: false
- name: dgp.filter.llm.proxy
config:
scheme: http
timeout: "60s"
maxIdleConns: 100
maxIdleConnsPerHost: 100
maxConnsPerHost: 100
clusters:
- name: llm
lb_policy: RoundRobin
endpoints:
- ID: vllm-instance-1
socket_address:
address: 127.0.0.1
port: 8000
llm_meta:
provider: vllm
api_key: "<api-key>"
fallback: false
health_check_interval: 5000
retry_policy:
name: ExponentialBackoff
config:
times: 3
initialInterval: "200ms"
maxInterval: "5s"
multiplier: 2.0
Nacos LLM registry mode example (conf.yaml):
static_resources:
listeners:
- name: net/http
protocol_type: HTTP
address:
socket_address:
address: 0.0.0.0
port: 8888
filter_chains:
filters:
- name: dgp.filter.httpconnectionmanager
config:
route_config:
routes:
- match:
prefix: /v1
route:
cluster: llm
http_filters:
- name: dgp.filter.llm.proxy
config:
scheme: http
timeout: "60s"
adapters:
- id: llm-nacos
name: dgp.adapter.llmregistrycenter
config:
registries:
nacos:
protocol: nacos
address: "127.0.0.1:8848"
timeout: "5s"
group: DEFAULT_GROUP
namespace: public
04 同仓库更多 Skills
pixiu-mcp-gateway
Creates and validates dubbo-go-pixiu MCP gateway conf.yaml. Use for MCP server filters, tools/list, tools/call, Mcp-Session-Id, MCP auth, Nacos MCP registry, or exposing backend HTTP APIs as MCP tools. Do not use for LLM model proxying.
pixiu-http-to-dubbo
Creates and debugs dubbo-go-pixiu HTTP-to-Dubbo route YAML. Use for api_config.yaml/conf.yaml routes, direct Dubbo URLs, registry-backed Dubbo, mappingParams, mapType, parameterTypes, opt.types/opt.values, or generic-invoke errors. Do not use for non-Dubbo HTTP proxy routes or new registry adapter implementation.
pixiu-filter-author
Creates and debugs dubbo-go-pixiu HTTP/Network filters. Use when adding, registering, or wiring Pixiu filters, or when a filter compiles but does not run. Do not use for adapter or protocol-listener SPI work.