Skip to content

Implement Phala AI adapter#767

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
Echolonius:feat/ai-adapter-phala
Jul 8, 2026
Merged

Implement Phala AI adapter#767
ralyodio merged 1 commit into
profullstack:masterfrom
Echolonius:feat/ai-adapter-phala

Conversation

@Echolonius

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the packages/ai/phala stub, which had the same class of bug as atlascloud (secretKey was a bare URL instead of an env var name, defaultModel/models were the string 'PHALA_API_KEY')
  • New implementation targets Phala's confidential-AI (GPU TEE) chat completions API, documented at docs.phala.com/phala-cloud/confidential-ai/confidential-model/api-reference/chat-completions
  • Base URL https://inference.phala.com/v1/chat/completions confirmed live (unauthenticated POST returns {"error":{"message":"Model parameter is required",...}})
  • Model IDs (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 guessed

Test plan

  • Added unit tests mirroring packages/ai/groq/src/index.test.ts (dry-run short-circuit, request shape, base URL override, error redaction, missing-key throw)
  • CI: pnpm --filter @profullstack/sh1pt-ai-phala typecheck && pnpm vitest run packages/ai/phala/src/index.test.ts

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.
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🤖 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: git fetch upstream master && git rebase upstream/master.

3 similar comments
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🤖 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: git fetch upstream master && git rebase upstream/master.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🤖 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: git fetch upstream master && git rebase upstream/master.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🤖 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: git fetch upstream master && git rebase upstream/master.

@ralyodio ralyodio merged commit 64bb906 into profullstack:master Jul 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants