Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)21k · #10365

debug-inference

Skill này làm gì

Skill này giúp AI tìm hiểu vì sao một lệnh gọi mô hình thất bại khi đi qua provider của OpenShell. Skill kiểm tra provider, endpoint được phép và nơi máy chủ mô hình cục bộ đang chạy. Skill dành cho nhà phát triển kết nối ứng dụng AI tới mô hình chạy trên dịch vụ đám mây hoặc mô hình cục bộ.

Khi nào nên dùng

  • ✓Khi các lệnh gọi mô hình của ứng dụng thất bại bên trong OpenShell và bạn không biết vì sao.
  • ✓Khi bạn muốn kết nối một mô hình cục bộ như Ollama hoặc vLLM với sandbox OpenShell.
  • ✓Khi bạn chuyển từ endpoint suy luận được quản lý cũ sang endpoint gốc của provider.

Liên kết skill

https://github.com/NVIDIA/OpenShell/blob/main/skills/debug-inference/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/NVIDIA/OpenShell/blob/main/skills/debug-inference/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Ứng dụng của tôi không kết nối được tới mô hình Ollama cục bộ từ bên trong OpenShell. Giúp tôi tìm nguyên nhân.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI kiểm tra gateway và sandbox, xem provider và hồ sơ của nó, rồi kiểm tra endpoint có truy cập được và được phép hay không. Sau đó AI giải thích nguyên nhân có khả năng nhất.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Debug Inference

Diagnose inference as ordinary provider-authorized network traffic. OpenShell no longer supplies a managed inference route, rewrites request shapes, or selects a model. The application calls the provider's native endpoint and owns its base URL, model, request format, and timeout.

Use installed openshell --help output as the authority for command syntax. Refer to the published provider management guide and provider profile guide for current behavior.

Diagnostic Workflow

1. Confirm Gateway and Sandbox Context

openshell status
openshell gateway info
openshell sandbox get <sandbox>

For a host-local model server, host.openshell.internal identifies the machine running the gateway. It does not identify the operator's laptop when the gateway is remote. A server listening only on 127.0.0.1 may also be unreachable from a container; bind it to an address reachable from the gateway runtime.

2. Inspect the Provider and Its Profile

openshell provider get <provider>
openshell profile export <profile-id> -o yaml

Check that the profile:

  • Names the exact endpoint host, port, and protocol the client calls.
  • Allows the client binary.
  • Declares the credential key and intended authentication style.
  • Uses narrow HTTP rules when the provider should expose only part of an API.

For a custom or self-hosted OpenAI-compatible endpoint, import an endpoint-bearing profile. A base URL stored only in provider configuration does not authorize a new endpoint.

openshell profile lint -f ./provider-profile.yaml
openshell profile import -f ./provider-profile.yaml
openshell provider create --name <provider> --type <profile-id>

Add the required --credential KEY or --credential KEY=VALUE arguments shown by the profile. Never broaden endpoint policy merely to silence a credential binding error.

3. Confirm Attachment

openshell sandbox provider list <sandbox>
openshell sandbox provider attach <sandbox> <provider> --wait --timeout 30

Save the change's receipt_id and use openshell sandbox provider status <sandbox> <provider> --receipt <receipt-id> --wait --timeout 30 to check when it takes effect. Success confirms that the sandbox applied the credentials, policy, and environment for new processes. If the result is pending, failed, withheld, or superseded, inspect its reason before launching the client.

Launch the client after the attachment wait succeeds so it receives the updated environment:

openshell sandbox exec <sandbox> -- <client-command>

After updating an ordinary static provider, wait for that change and launch a new client. An existing process keeps its revision-scoped reference; readiness does not make the old reference resolve the replacement value. Diagnose managed-refresh credentials according to their own lifecycle.

Keep credentials and issued references out of diagnostic output. Acknowledged detach revokes future credential resolution and removes the reference from future process environments. Requests already forwarded may still finish:

openshell sandbox provider detach <sandbox> <provider> --wait --timeout 30

4. Verify Native Client Configuration

The application must use the real upstream contract:

  • Native provider base URL, not the retired managed virtual endpoint.
  • Real model ID, not a placeholder that OpenShell used to rewrite.
  • Native OpenAI, Anthropic, Vertex, or other provider request shape.
  • Application-owned timeout and retry settings.
  • The credential environment variable declared by the attached profile.

Probe the exact endpoint from a newly launched sandbox process. Start with a non-secret discovery endpoint when the provider offers one, then send a minimal inference request using the provider's documented API shape.

5. Interpret Common Failures

Symptom Likely cause Fix
credential_placeholder_in_request_body A body reference is invalid/revoked, or classification metadata is unavailable Check the controlled denial reason; remove the reference from conversation history or restore provider access. Do not enable body credential rewriting or bypass flags to send tool output. Unknown literals and valid issued placeholders pass unchanged, including the model provider’s own placeholder. Header resolution
Câu hỏi thường gặp

OpenShell có chọn mô hình hoặc viết lại yêu cầu không?

Không. Ứng dụng gọi endpoint gốc của provider và tự đặt mô hình, base URL và định dạng yêu cầu.

Skill có giúp với máy chủ mô hình cục bộ không?

Có. Skill bao gồm các máy chủ như Ollama, vLLM và LM Studio chạy trên máy của gateway.

Nếu máy chủ mô hình chỉ lắng nghe trên localhost thì sao?

Skill lưu ý máy chủ như vậy có thể không truy cập được từ container, nên cần lắng nghe trên địa chỉ mà gateway truy cập được.

Chi tiết

Mô tả gốc của tác giả

Debug inference clients that use an attached provider and its native endpoint, including hosted APIs and host-local Ollama, vLLM, SGLang, TRT-LLM, LM Studio, or NIM. Use for provider attachment, endpoint policy, credential substitution, topology, and migration from the removed managed inference endpoint. Trigger keywords - debug inference, managed inference endpoint, local inference, ollama, lm studio, vllm, sglang, trtllm, NIM, inference failing, model server unreachable, credential_endpoint_mismatch, host.openshell.internal.

repo: NVIDIA/OpenShell

Độ phổ biến

Sao GitHub
21k
Vị trí xếp hạng
#10365
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự