|
1 | | -#V04302026 |
| 1 | +#V05012026 |
2 | 2 | #!/usr/bin/env python3 |
3 | 3 | """ |
4 | 4 | CAIOS Inference Wrapper |
@@ -104,45 +104,32 @@ def get_personalized_prompt(): |
104 | 104 |
|
105 | 105 | def select_client(clients: Dict[str, Any]) -> tuple: |
106 | 106 | """Let user choose a model from available clients.""" |
107 | | - |
108 | | - # Check if Ollama is available |
109 | | - try: |
110 | | - import ollama_config |
111 | | - ollama_available = ollama_config.check_ollama_available() |
112 | | - except: |
113 | | - ollama_available = False |
114 | | - |
115 | | - print("\nAvailable models:") |
116 | 107 | options = list(clients.keys()) |
117 | 108 |
|
118 | | - # Add Ollama as option if running |
119 | | - if ollama_available: |
120 | | - options.insert(0, "ollama_local") |
121 | | - print(f" 1. OLLAMA (Local - Tier {ollama_config.NODE_TIER})") |
122 | | - offset = 1 |
123 | | - else: |
124 | | - offset = 0 |
125 | | - |
126 | | - for i, provider in enumerate(options[offset:], 1 + offset): |
127 | | - print(f" {i}. {provider.upper()}") |
128 | | - |
129 | | - if not clients: |
130 | | - print("No API clients available. Run master_init.py first.") |
| 109 | + if not options: |
| 110 | + print("No clients available. Run master_init.py first.") |
131 | 111 | sys.exit(1) |
132 | 112 |
|
133 | 113 | print("\nAvailable models:") |
134 | | - options = list(clients.keys()) |
135 | 114 | for i, provider in enumerate(options, 1): |
136 | | - print(f" {i}. {provider.upper()}") |
| 115 | + if provider == 'ollama_local': |
| 116 | + try: |
| 117 | + import ollama_config |
| 118 | + print(f" {i}. OLLAMA Local " |
| 119 | + f"(Tier {ollama_config.NODE_TIER} | " |
| 120 | + f"{ollama_config.SYSTEM_CONFIG.get('ollama_model', 'local')})") |
| 121 | + except Exception: |
| 122 | + print(f" {i}. OLLAMA Local") |
| 123 | + else: |
| 124 | + print(f" {i}. {provider.upper()}") |
137 | 125 |
|
138 | 126 | while True: |
139 | 127 | try: |
140 | 128 | choice = int(input("\nSelect model (number): ")) |
141 | 129 | if 1 <= choice <= len(options): |
142 | 130 | provider = options[choice - 1] |
143 | 131 | return provider, clients[provider] |
144 | | - else: |
145 | | - print(f"Please enter a number between 1 and {len(options)}.") |
| 132 | + print(f"Please enter a number between 1 and {len(options)}.") |
146 | 133 | except ValueError: |
147 | 134 | print("Please enter a valid number.") |
148 | 135 |
|
|
0 commit comments