Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client wraps the OpenAI client to provide secure inference through Tinfoil
func NewClient ¶
func NewClient(openaiOpts ...option.RequestOption) (*Client, error)
NewClient creates a new secure OpenAI client using default parameters
func NewClientWithOptions ¶ added in v0.12.11
func NewClientWithOptions(opts ...ClientOption) (*Client, error)
NewClientWithOptions creates a secure OpenAI client configured through functional options. By default it selects a router automatically, verifies against the default config repository, and uses the EHBP transport.
func NewClientWithParams ¶
func NewClientWithParams(enclave, repo string, openaiOpts ...option.RequestOption) (*Client, error)
NewClientWithParams creates a new secure OpenAI client with explicit enclave and repo parameters
func (*Client) HTTPClient ¶ added in v0.12.0
HTTPClient returns the underlying HTTP client that is configured with automatic certificate re-verification and is restricted to TLS connections to the verified enclave. This can be used for secure, direct HTTP requests to the enclave.
func (*Client) Transport ¶ added in v0.12.11
func (c *Client) Transport() TransportMode
Transport returns the transport mode used to secure traffic to the enclave.
type ClientOption ¶ added in v0.12.11
type ClientOption func(*clientConfig)
ClientOption configures a Client created with NewClientWithOptions.
func WithEnclave ¶ added in v0.12.11
func WithEnclave(enclave string) ClientOption
WithEnclave sets the enclave host to verify and connect to. When unset, a router is selected automatically.
func WithOpenAIOptions ¶ added in v0.12.11
func WithOpenAIOptions(opts ...option.RequestOption) ClientOption
WithOpenAIOptions appends options passed through to the underlying OpenAI client.
func WithRepo ¶ added in v0.12.11
func WithRepo(repo string) ClientOption
WithRepo sets the GitHub repository used for code measurement verification.
func WithTransport ¶ added in v0.12.11
func WithTransport(mode TransportMode) ClientOption
WithTransport selects the transport mode. Defaults to TransportEHBP.
type TransportMode ¶ added in v0.12.11
type TransportMode string
TransportMode selects how the SDK secures traffic to the enclave.
const ( // TransportEHBP encrypts request bodies end-to-end with HPKE via the // Encrypted HTTP Body Protocol. Only the verified enclave can decrypt them, // so it works through proxies. This is the default. TransportEHBP TransportMode = "ehbp" // TransportTLS pins the enclave's TLS certificate. All traffic is encrypted // and terminated at the verified enclave, which requires a direct // connection (requests through a proxy will fail). TransportTLS TransportMode = "tls" )
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
chat
command
|
|
|
verifier
module
|
|
|
examples/client
command
|
|
|
examples/verifier
command
|
|
|
rootfetch
command
|
|