CLI Reference¶
Oblix provides a powerful command-line interface (CLI) that enables you to interact with the Oblix AI Orchestration SDK directly from your terminal. This tool simplifies hybrid model orchestration between cloud and edge environments.
Installation¶
The Oblix CLI is included with the main Oblix SDK package when you install it via pip:
Note: Currently, Oblix only supports macOS. Windows and Linux versions are planned for future releases. Supported Python versions: 3.9, 3.10, 3.11, 3.12, 3.13.
Basic Usage¶
Once installed, you can access the CLI by using the oblix
command in your terminal:
This will display the available commands and options.
Command Structure¶
The Oblix CLI follows this general structure:
Orchestration Capabilities¶
Oblix is designed specifically for orchestrating AI workloads between cloud and edge environments. Rather than running models in isolation, Oblix's CLI provides:
- Automatic orchestration between local and cloud models based on resource availability and connectivity
- Dynamic routing of prompts to the most appropriate model
- Monitoring agents that continuously assess system state
- Seamless fallback between models when conditions change
Available Commands¶
Command | Description |
---|---|
models |
Manage and interact with AI models (both local and cloud) |
agents |
Manage and interact with Oblix orchestration agents |
sessions |
Manage chat sessions |
execute |
Execute a single prompt with orchestration |
chat |
Start an interactive chat session with hybrid model orchestration |
Authentication¶
Most commands require an Oblix API key, which can be provided in several ways:
- Using the
--api-key
option with each command - Setting the
OBLIX_API_KEY
environment variable - When not provided, the CLI will prompt you to enter it
Example:
Common Options¶
These options are available for most commands:
Option | Description |
---|---|
--help , -h |
Display help for a command |
--version |
Show the Oblix CLI version |
--debug |
Enable debug logging |
Models Commands¶
Commands for managing AI models across cloud and edge:
List Models¶
List all configured models:
Hook Model¶
Add a new model to the orchestration system:
# Hook a local Ollama model
oblix models hook --type ollama --name llama2
# Hook a cloud OpenAI model
oblix models hook --type openai --name gpt-3.5-turbo --api-key-model YOUR_OPENAI_KEY
# Hook a cloud Claude model
oblix models hook --type claude --name claude-3-haiku-20240307 --api-key-model YOUR_ANTHROPIC_KEY
Model Info¶
Get information about a specific model:
Agents Commands¶
Commands for interacting with Oblix orchestration agents:
Connectivity¶
Check current connectivity metrics (critical for orchestration decisions):
Resource¶
Perform a system resource check (impacts model routing decisions):
Sessions Commands¶
Commands for managing orchestrated chat sessions:
List Sessions¶
List recent chat sessions:
View Session¶
View details of a specific session:
Delete Session¶
Delete a specific chat session:
Create Session¶
Create a new chat session:
Orchestrated Execution and Chat¶
Execute prompts with automatic orchestration between cloud and edge:
Execute a Prompt with Orchestration¶
Let Oblix decide which model to use based on system state:
With a specific model (bypassing orchestration):
Start Interactive Chat with Hybrid Orchestration¶
Start an interactive chat session with automatic orchestration between cloud and edge models:
With Claude as the cloud model:
Orchestration Examples¶
Here are some common orchestration use cases for the Oblix CLI:
Setting Up Hybrid Model Orchestration¶
# Set up local and cloud models for orchestration
oblix models hook --type ollama --name llama2
oblix models hook --type openai --name gpt-3.5-turbo --api-key-model YOUR_OPENAI_KEY
# Start interactive chat with model orchestration
oblix chat --local-model llama2 --cloud-model gpt-3.5-turbo
Checking Orchestration System Status¶
# Check system resource metrics (affects local model selection)
oblix agents resource
# Check connectivity metrics (affects cloud model selection)
oblix agents connectivity
Managing Orchestrated Sessions¶
# List recent sessions
oblix sessions list
# Create a new session
oblix sessions create --title "Research Project"
# Execute with a specific session
oblix execute "Research quantum computing papers" --session-id YOUR_SESSION_ID
Environment Variables¶
Variable | Description |
---|---|
OBLIX_API_KEY |
Your Oblix API key |
OPENAI_API_KEY |
Your OpenAI API key (used as default for OpenAI models) |
ANTHROPIC_API_KEY |
Your Anthropic API key (used as default for Claude models) |
Troubleshooting¶
If you encounter issues with the CLI:
- Ensure you're using the latest version of Oblix
- Check that you've properly set up your API keys
- Enable debug logging with the
--debug
flag - Verify that the Ollama server is running if using local models
- Confirm your Mac meets the system requirements (particularly for larger models)
- Check network connectivity if cloud models aren't responding
For additional help, join the Oblix Discord community at https://discord.gg/v8qtEVuU.