Set up a Python LLM dev environment
Task: Reproducible Local Python Environment for a Mistral Agent
You are tasked with setting up a clean, fully reproducible local Python development environment for a small Mistral-based agent. The setup must be verified by successfully making a real API call to the Mistral service.
Assume a Unix-like shell environment (macOS/Linux). If operating on Windows, utilize WSL or equivalent Windows-native tools.
Requirements
- Python Version Management: Install a specific Python version (e.g., Python 3.11.x) using
pyenv. - Isolated Environment: Create and activate an isolated virtual environment for the project.
- Dependency Management: Ensure reproducible dependency installs using a lockfile mechanism.
- Secret Configuration: Configure API keys and other sensitive information via environment variables, strictly avoiding their commitment to version control.
- Project Structure: Design a project layout that facilitates quick local execution and testing.
- Verification: Implement a short script that makes a test call to the Mistral API and prints the model name to confirm the environment's functionality.
Deliverables
- Clear, step-by-step setup commands with minimal rationale for each action.
- A basic project skeleton, including necessary directories and key files.
- A Python script capable of calling the Mistral API and extracting/printing the model name.
- Concise notes detailing how to run the verification script and validate the environment.
AI interview prep
Core dilemma
Balancing developer convenience and rapid iteration with strict environmental reproducibility, security best practices for secrets, and maintainability for future growth.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Set up a Python LLM dev environment
Task: Reproducible Local Python Environment for a Mistral Agent
You are tasked with setting up a clean, fully reproducible local Python development environment for a small Mistral-based agent. The setup must be verified by successfully making a real API call to the Mistral service.
Assume a Unix-like shell environment (macOS/Linux). If operating on Windows, utilize WSL or equivalent Windows-native tools.
Requirements
- Python Version Management: Install a specific Python version (e.g., Python 3.11.x) using
pyenv. - Isolated Environment: Create and activate an isolated virtual environment for the project.
- Dependency Management: Ensure reproducible dependency installs using a lockfile mechanism.
- Secret Configuration: Configure API keys and other sensitive information via environment variables, strictly avoiding their commitment to version control.
- Project Structure: Design a project layout that facilitates quick local execution and testing.
- Verification: Implement a short script that makes a test call to the Mistral API and prints the model name to confirm the environment's functionality.
Deliverables
- Clear, step-by-step setup commands with minimal rationale for each action.
- A basic project skeleton, including necessary directories and key files.
- A Python script capable of calling the Mistral API and extracting/printing the model name.
- Concise notes detailing how to run the verification script and validate the environment.