🔌 API & Configuration

Configure DJINN, set up LLM backends, and customize your experience.

🤖 LLM Backend Setup

DJINN needs an AI backend to generate commands. Choose one:

LM Studio

Local with GUI. Choose any GGUF model.

Setup

# 1. Download from https://lmstudio.ai

# 2. Load a model in LM Studio

# 3. Start local server (port 1234)

# 4. Configure DJINN
djinn config set provider lmstudio
djinn config set api_url http://localhost:1234/v1

OpenAI

Cloud-based. Requires API key.

Setup

# 1. Get API key from https://platform.openai.com

# 2. Set environment variable
export OPENAI_API_KEY="sk-..."

# 3. Configure DJINN
djinn config set provider openai
djinn config set model gpt-4

Available Models

gpt-4o Latest, best quality
gpt-4 Very capable
gpt-3.5-turbo Fast, cheaper

⚙️ Configuration

View Configuration

djinn config show

Available Settings

Setting Description Default
provider LLM provider (ollama, lmstudio, openai) ollama
model Model name llama3.2
api_url Custom API URL -
temperature Generation temperature (0.0-1.0) 0.7
max_tokens Maximum response tokens 1024
theme UI theme default
auto_execute Auto-execute commands false

Set Configuration

djinn config set provider ollama
djinn config set model llama3.2
djinn config set temperature 0.5
djinn config set theme cyberpunk

Reset to Defaults

djinn config reset

🎨 Themes

DJINN comes with 8 beautiful themes.

djinn theme list      # List all themes
djinn theme set NAME  # Set theme

default

Clean, professional look

cyberpunk

Neon pink and cyan

retro

Classic green terminal

nord

Arctic, blue-tinted

dracula

Dark theme with purple

solarized

Eye-friendly colors

monokai

Popular syntax colors

light

Light background

📦 Model Management

For Ollama users, manage models directly from DJINN.

# List installed models
djinn model list

# Browse available models
djinn model browse

# Download a model
djinn model download llama3.2
djinn model download codellama:7b

# Get model info
djinn model info llama3

# Delete a model
djinn model delete old-model

# Get recommendations based on your hardware
djinn model recommend

Model Recommendations by VRAM

VRAM Recommended Models
4GB phi3, tinyllama
8GB llama3.2:8b, mistral, codellama:7b
16GB llama3.2:70b-q4, codellama:34b
24GB+ llama3:70b, mixtral

🔐 Environment Variables

DJINN respects these environment variables:

Variable Description
OPENAI_API_KEY OpenAI API key (for OpenAI provider)
GITHUB_TOKEN GitHub token (for gist command)
DJINN_CONFIG Custom config file path
DJINN_THEME Override theme

📄 Config File Location

DJINN stores configuration in:

Windows %USERPROFILE%\.djinn\config.json
macOS/Linux ~/.djinn/config.json

Sample Config

{
  "provider": "ollama",
  "model": "llama3.2",
  "temperature": 0.7,
  "max_tokens": 1024,
  "theme": "cyberpunk",
  "auto_execute": false,
  "history_size": 100
}

🔗 Aliases

Create shortcuts for common prompts.

# Add alias
djinn alias add deploy "deploy to production server"
djinn alias add lint "run linter and fix issues"

# List aliases
djinn alias list

# Use alias
djinn @deploy
djinn @lint

# Remove alias
djinn alias remove deploy

🔄 Settings Sync

Export and import your DJINN configuration.

# Export settings
djinn sync export
# Creates djinn-settings.json

# Import settings
djinn sync import djinn-settings.json

# Create shareable link
djinn sync share
# Outputs base64 link