JavaScript and TypeScript client library for interacting with Gradio APIs, providing methods to connect to, submit predictions to, and manage connections with Gradio applications.
Overall
score
96%
Build a tool that creates a copy of a Hugging Face Space with custom hardware settings and privacy configuration.
Create a TypeScript application that duplicates Hugging Face Spaces with custom hardware tiers, privacy settings, and timeout configurations. The tool must handle authentication and verify the duplicated space is operational.
Duplicate an existing space to a new location with authentication.
Configure specific hardware tiers when duplicating spaces.
Create private duplicated spaces that require authentication to access.
Set sleep timeout on duplicated spaces for cost optimization.
@generates
/**
* Configuration options for space duplication
*/
export interface DuplicateSpaceOptions {
/** Hugging Face API token (required) */
hfToken: string;
/** Source space reference (e.g., "user/space-name") */
sourceSpace: string;
/** Target space name (e.g., "user/new-space-name") */
targetSpace: string;
/** Hardware tier for the duplicated space */
hardware?: "cpu-basic" | "cpu-upgrade" | "cpu-xl" |
"t4-small" | "t4-medium" |
"a10g-small" | "a10g-large" | "a10g-largex2" | "a10g-largex4" |
"a100-large" | "zero-a10g" | "h100" | "h100x8";
/** Whether the duplicated space should be private */
private?: boolean;
/** Sleep timeout in seconds for cost management */
timeout?: number;
}
/**
* Result of space duplication operation
*/
export interface DuplicationResult {
/** The reference to the duplicated space */
spaceRef: string;
/** Whether the space is private */
isPrivate: boolean;
/** Hardware configuration applied */
hardware?: string;
/** Whether connection to the space was successful */
connected: boolean;
}
/**
* Duplicates a Hugging Face Space with specified configuration
*
* @param options - Configuration for space duplication
* @returns Promise resolving to duplication result
* @throws Error if authentication fails or space duplication fails
*/
export async function duplicateSpace(options: DuplicateSpaceOptions): Promise<DuplicationResult>;Provides client library for interacting with Gradio applications and managing Hugging Face Spaces.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-gradio--clientevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10