support nvidia and compatible api
This commit is contained in:
parent
fa4d01c23a
commit
4d98734d13
|
|
@ -1,4 +1,5 @@
|
|||
import questionary
|
||||
import os
|
||||
from typing import List, Optional, Tuple, Dict
|
||||
|
||||
from rich.console import Console
|
||||
|
|
@ -242,6 +243,8 @@ def select_llm_provider() -> tuple[str, str | None]:
|
|||
("OpenRouter", "openrouter", "https://openrouter.ai/api/v1"),
|
||||
("Azure OpenAI", "azure", None),
|
||||
("Ollama", "ollama", "http://localhost:11434/v1"),
|
||||
("Nvidia", "nvidia", "https://integrate.api.nvidia.com/v1"),
|
||||
("OpenAICompatible", "openaicompatible", os.environ.get("OPENAI_BASE_URL")),
|
||||
]
|
||||
|
||||
choice = questionary.select(
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from .azure_client import AzureOpenAIClient
|
|||
|
||||
# Providers that use the OpenAI-compatible chat completions API
|
||||
_OPENAI_COMPATIBLE = (
|
||||
"openai", "xai", "deepseek", "qwen", "glm", "ollama", "openrouter",
|
||||
"openai", "xai", "deepseek", "qwen", "glm", "ollama", "openrouter","nvidia","openaicompatible"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,22 @@ MODEL_OPTIONS: ProviderModeOptions = {
|
|||
("Custom model ID", "custom"),
|
||||
],
|
||||
},
|
||||
"nvidia": {
|
||||
"quick": [
|
||||
("Custom model ID", "custom"),
|
||||
],
|
||||
"deep": [
|
||||
("Custom model ID", "custom"),
|
||||
],
|
||||
},
|
||||
"openaicompatible": {
|
||||
"quick": [
|
||||
("Custom model ID", "custom"),
|
||||
],
|
||||
"deep": [
|
||||
("Custom model ID", "custom"),
|
||||
],
|
||||
},
|
||||
# OpenRouter: fetched dynamically. Azure: any deployed model name.
|
||||
"ollama": {
|
||||
"quick": [
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ _PROVIDER_CONFIG = {
|
|||
"glm": ("https://api.z.ai/api/paas/v4/", "ZHIPU_API_KEY"),
|
||||
"openrouter": ("https://openrouter.ai/api/v1", "OPENROUTER_API_KEY"),
|
||||
"ollama": ("http://localhost:11434/v1", None),
|
||||
"nvidia": ("https://integrate.api.nvidia.com/v1", "NVIDIA_API_KEY"),
|
||||
"openaicompatible": (os.environ.get("OPENAI_BASE_URL"), "OPENAI_API_KEY"),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue