Skip to content

Fix/issue 6400 provider fix#6551

Open
datascientist970 wants to merge 28 commits intoaden-hive:mainfrom
datascientist970:fix/issue-6400-provider-fix
Open

Fix/issue 6400 provider fix#6551
datascientist970 wants to merge 28 commits intoaden-hive:mainfrom
datascientist970:fix/issue-6400-provider-fix

Conversation

@datascientist970
Copy link

Fixes #6400

Description

This PR addresses multiple issues with LLM provider selection, model management, and persistent configuration. The changes ensure users can select, change, and persist their model choices without manual configuration file editing.

Key Changes

1. Provider Selection Flow Improvements

  • Model selection now happens BEFORE API key entry - Users see model options with descriptions first
  • Added rich model metadata (tier, speed, quality) with visual icons
  • Fixed Gemini provider detection to use API key mode instead of Vertex AI
  • Added emergency provider detection for cases where provider is missing

2. Persistent Model Management CLI

Added new hive model commands:

# List all available models with descriptions
hive model list
hive model list --provider gemini

# Show current configuration
hive model show

# Interactive model changer
hive model change

3. Configuration Fixes

  • Fixed save_configuration() function to properly create ~/.hive/configuration.json
  • Added model_display field to store user-friendly model names
  • Ensured configuration persists across sessions
  • Added proper error handling and debugging output

4. Gemini API Fixes

  • Fixed model names to use correct API values (from ListModels output)
  • Added _force_gemini_api_mode() to disable Vertex AI
  • Set environment variables correctly for all providers
  • Added emergency detection to add provider prefix when missing

5. Quickstart Improvements

  • Updated model arrays to use correct Gemini model names:
    • gemini-2.5-flash - Fast, free tier
  • Fixed display name capture in model selection
  • Added debug logging for troubleshooting

Files Changed

File Changes
quickstart.sh Updated model arrays, fixed save_configuration, added display name capture
core/framework/llm/litellm.py Added emergency provider detection, forced Gemini API mode, fixed model formatting
core/framework/llm/provider_models.py Updated Gemini model names to correct API values
core/framework/model_cli.py New file with model management commands
core/framework/cli.py Registered new model commands
core/framework/config.py Added save_config function and helper methods

How to Test

  1. Fresh Setup

    rm -rf ~/.hive/
    ./quickstart.sh
    # Select Gemini, choose model, enter API key
  2. Model Management

    ./hive model list
    ./hive model show
    ./hive model change
  3. Verify Configuration

    cat ~/.hive/configuration.json
    # Should show correct provider and model
  4. Start Hive

    ./hive open
    # Check logs for "provider = gemini" not "vertex_ai"

Testing Checklist

  • Provider selection works for all providers
  • Model menu shows with descriptions and icons
  • Configuration file is created properly
  • hive model commands work
  • Gemini uses API key mode (not Vertex AI)
  • Changes persist after restart
  • API key validation works
  • Windows path compatibility
  • Deprecation warnings don't break JSON parsing

Related Issues

Notes

  • Deprecation warnings from anthropic.py are harmless and don't affect functionality
  • Gemini free tier has daily limits (150 requests/day for 2.5 Flash)
  • Users can switch models anytime with hive model change

This PR makes Hive's model management user-friendly and eliminates the need for manual configuration file editing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Persistent Model Management CLI Commands

1 participant