Implement Phala AI adapter#767
Conversation
Replace the placeholder stub (secretKey was a bare URL, model was the key name) with a working client for Phala's confidential-AI chat completions API, following the groq adapter's pattern. Endpoint and model IDs pulled directly from docs.phala.com's API reference (https://inference.phala.com/v1/chat/completions) and confirmed live against an unauthenticated request.
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
3 similar comments
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
Summary
packages/ai/phalastub, which had the same class of bug as atlascloud (secretKeywas a bare URL instead of an env var name,defaultModel/modelswere the string'PHALA_API_KEY')docs.phala.com/phala-cloud/confidential-ai/confidential-model/api-reference/chat-completionshttps://inference.phala.com/v1/chat/completionsconfirmed live (unauthenticated POST returns{"error":{"message":"Model parameter is required",...}})phala/qwen3.5-27b,phala/gemma-3-27b-it,z-ai/glm-5,openai/gpt-oss-120b) taken directly from the documented request examples, not guessedTest plan
packages/ai/groq/src/index.test.ts(dry-run short-circuit, request shape, base URL override, error redaction, missing-key throw)pnpm --filter @profullstack/sh1pt-ai-phala typecheck && pnpm vitest run packages/ai/phala/src/index.test.ts