Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
"name": "Inference-client: Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:2-3.14-trixie",
"image": "mcr.microsoft.com/devcontainers/python:3.14-trixie",
"runArgs": ["--env-file", ".devcontainer/.env"],

// Features to add to the dev container. More info: https://containers.dev/features.
Expand All @@ -30,7 +30,10 @@
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"ruff.nativeServer": "on"
"ruff.nativeServer": "on",
"ruff.lint.ignore": [
"F401" // Unused imports: Auto formatting on save means unused imports are removed, which is very annoying in dev
]
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
Expand Down
12 changes: 0 additions & 12 deletions src/inference_client/providers/ollama/ollama_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,6 @@ def supported_models(self) -> list[str]:
else []
)

if not models:
raise InferenceRequestError(
"No models available in Ollama. "
"Please pull at least one model using: ollama pull <model-name>"
)

# Extract model names - handle both Model objects and dicts
model_names = []
for model in models:
Expand All @@ -188,12 +182,6 @@ def supported_models(self) -> list[str]:
if name:
model_names.append(name)

if not model_names:
raise InferenceRequestError(
"No models available in Ollama. "
"Please pull at least one model using: ollama pull <model-name>"
)

return model_names

except Exception as e:
Expand Down
7 changes: 2 additions & 5 deletions tests/providers/test_ollama_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,8 @@ def test_supported_models_empty_list(self, mock_client_class):
mock_client.list.return_value = {"models": []}

provider = OllamaProvider()

with pytest.raises(
InferenceRequestError, match="No models available in Ollama"
):
provider.supported_models()
models = provider.supported_models()
assert len(models) == 0

@patch("inference_client.providers.ollama.ollama_provider.Client")
def test_supported_models_connection_error(self, mock_client_class):
Expand Down
Loading