Features Supported
The GravixLayer SDKs currently support:- Chat Completions - Text generation and conversation handling
- Completions - Text completion and generation endpoint (prompt-based)
- Embeddings API - Text embeddings for semantic search and similarity
- Streaming Responses - Real-time response streaming for both chat and completions
- Asynchronous Support - Non-blocking operations with async/await
- Function Calling - Tool integration and function calling capabilities
- CLI Interface - Command-line interface for all endpoints
- Deployment Management - Create, manage, and deploy dedicated model instances
- Logging - Built-in logging capabilities
- HTTP Support - Support for HTTP requests for local development
GravixLayer Client
Working with the GravixLayer API is as simple as instantiating the client and making requests:- Python SDK
- JavaScript SDK
Completions
For simple prompt-based text generation, use the completions endpoint:- Python SDK
- JavaScript SDK
Streaming Completions
- Python SDK
- JavaScript SDK
Chat Completions
You can customize various parameters to take full advantage of the available models:- Python SDK
- JavaScript SDK
Streaming Responses
For real-time applications, you can stream responses as they’re generated:- Python SDK
- JavaScript SDK
Async Support
The SDKs provide full async support for high-performance applications:- Python SDK
- JavaScript SDK
CLI Interface
The GravixLayer SDK includes a powerful command-line interface for quick testing and automation:CLI Structure: The CLI uses subcommands for different operations:
gravixlayer chat- For chat completions, text completions, and embeddingsgravixlayer deployments- For deployment managementgravixlayer files- For file management
Chat Completions via CLI
Text Completions via CLI
Embeddings via CLI
Deployments via CLI
The CLI also supports deployment management for dedicated model instances:CLI Options
Main Commands:chat: Chat and completion operationsdeployments: Deployment managementfiles: File management
--mode: Operation mode (chat,completions,embeddings)--model: Model to use--user: User message for chat mode--prompt: Prompt for completions mode--text: Text for embeddings mode--system: System message for chat mode--stream: Enable streaming output--max-tokens: Maximum tokens to generate--temperature: Sampling temperature (0.0-2.0)--top-p: Nucleus sampling parameter--frequency-penalty: Frequency penalty (-2.0 to 2.0)--presence-penalty: Presence penalty (-2.0 to 2.0)
Key Concepts
Models
GravixLayer provides access to various language models. Specify the model using the model identifier:- Python SDK
- JavaScript SDK
Message Format (Chat Completions)
Messages follow the OpenAI chat format:- Python SDK
- JavaScript SDK
Prompt Format (Completions)
For the completions endpoint, use a simple string prompt:- Python SDK
- JavaScript SDK
Temperature and Parameters
Control model behavior with various parameters:- Python SDK
- JavaScript SDK

