Skip to content

Recommandation #1

@genwch

Description

@genwch

Environment Variables for Initialization:
I recommend using environment variables to initialize the following parameters when using lm-studio:
API_URL: The URL for the API you’re interacting with.
API_KEY: Your API key for authentication.
model: The specific model you want to use.

Listening on 0.0.0.0:
To make the Flask application listen on all available network interfaces, set the host to 0.0.0.0 in your Flask app configuration.

Docker release:
build the Dockerfile and use CI/CD to make the docker image release.

recommended Dockerfile

# Use the official Python image as the base
FROM python:3.9

# Set environment variable for API_URL (default value)
ENV LMSTUDIO_URL="http://localhost:1234/v1"
ENV LMSTUDIO_KEY="lm-studio"
ENV LMSTUDIO_MODEL="model-identifier"

# Set working directory
WORKDIR /app

# Copy requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy your Python code into the container
COPY . .

# Expose port 5000 (assuming your app runs on this port)
EXPOSE 5000

# Command to run your app
CMD ["python", "main.py", "lmstudio"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions