Skip to content
Open
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
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,17 @@ For more details on the usage of these commands, refer to the [User Guide](https
Example:

```python
>>> from vec_inf.api import VecInfClient
>>> client = VecInfClient()
>>> # Assume VEC_INF_ACCOUNT and VEC_INF_WORK_DIR is set
>>> response = client.launch_model("Meta-Llama-3.1-8B-Instruct")
>>> job_id = response.slurm_job_id
>>> status = client.get_status(job_id)
>>> if status.status == ModelStatus.READY:
... print(f"Model is ready at {status.base_url}")
>>> # Alternatively, use wait_until_ready which will either return a StatusResponse or throw a ServerError
>>> try:
>>> status = wait_until_ready(job_id)
>>> except ServerError as e:
>>> print(f"Model launch failed: {e}")
>>> client.shutdown_model(job_id)
ffrom vec_inf.client import VecInfClient
from vec_inf.client.models import ModelStatus

client = VecInfClient()
# Assume VEC_INF_ACCOUNT and VEC_INF_WORK_DIR is set
response = client.launch_model("Meta-Llama-3.1-8B-Instruct")
job_id = response.slurm_job_id
status = client.get_status(job_id)
if status == ModelStatus.READY:
print(f"Model is ready at {status.base_url}")
client.shutdown_model(job_id)
```

For details on the usage of the API, refer to the [API Reference](https://vectorinstitute.github.io/vector-inference/api/)
Expand Down
2 changes: 1 addition & 1 deletion vec_inf/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class VecInfClient:

Examples
--------
>>> from vec_inf.api import VecInfClient
>>> from vec_inf.client import VecInfClient
>>> client = VecInfClient()
>>> response = client.launch_model("Meta-Llama-3.1-8B-Instruct")
>>> job_id = response.slurm_job_id
Expand Down
2 changes: 1 addition & 1 deletion venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export UV_CACHE_DIR=/scratch/$(whoami)/uv_cache

# To see if the cache directory is set correctly, run the following command
# uv config get cache-dir
echo "Cache directory set to: $(uv config get cache-dir)"
echo "Cache directory set to: $(uv cache dir)"

# Install dependencies via uv
uv sync
Expand Down