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
11 changes: 8 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TOGETHER_API_KEY=
#Get your Hyperbolics API Key at https://app.hyperbolic.xyz/settings
#baseURL="https://api.hyperbolic.xyz/v1/chat/completions"
HYPERBOLIC_API_KEY=
HYPERBOLIC_API_BASE_URL=
HYPERBOLIC_API_BASE_URL=

# Get your Mistral API Key by following these instructions -
# https://console.mistral.ai/api-keys/
Expand All @@ -78,7 +78,7 @@ LMSTUDIO_API_BASE_URL=
# You only need this environment variable set if you want to use xAI models
XAI_API_KEY=

# Get your Perplexity API Key here -
# Get your Perplexity API Key here -
# https://www.perplexity.ai/settings/api
# You only need this environment variable set if you want to use Perplexity models
PERPLEXITY_API_KEY=
Expand All @@ -97,8 +97,13 @@ AWS_BEDROCK_CONFIG=
# Include this environment variable if you want more logging for debugging locally
VITE_LOG_LEVEL=debug

# Set this to the allowed hosts for your application, separated by commas
# Example: VITE_ALLOWED_HOSTS=localhost,127.0.0.1,myapp.com
# Leave empty if you don't need to restrict allowed hosts
VITE_ALLOWED_HOSTS=

# Example Context Values for qwen2.5-coder:32b
#
#
# DEFAULT_NUM_CTX=32768 # Consumes 36GB of VRAM
# DEFAULT_NUM_CTX=24576 # Consumes 32GB of VRAM
# DEFAULT_NUM_CTX=12288 # Consumes 26GB of VRAM
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ARG TOGETHER_API_BASE_URL
ARG AWS_BEDROCK_CONFIG
ARG VITE_LOG_LEVEL=debug
ARG DEFAULT_NUM_CTX
ARG VITE_ALLOWED_HOSTS

ENV WRANGLER_SEND_METRICS=false \
GROQ_API_KEY=${GROQ_API_KEY} \
Expand All @@ -49,7 +50,8 @@ ENV WRANGLER_SEND_METRICS=false \
AWS_BEDROCK_CONFIG=${AWS_BEDROCK_CONFIG} \
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}\
RUNNING_IN_DOCKER=true
RUNNING_IN_DOCKER=true\
VITE_ALLOWED_HOSTS=${VITE_ALLOWED_HOSTS}

# Pre-configure wrangler to disable metrics
RUN mkdir -p /root/.config/.wrangler && \
Expand All @@ -64,7 +66,7 @@ FROM base AS bolt-ai-development

# Define the same environment variables for development
ARG GROQ_API_KEY
ARG HuggingFace
ARG HuggingFace
ARG OPENAI_API_KEY
ARG ANTHROPIC_API_KEY
ARG OPEN_ROUTER_API_KEY
Expand All @@ -75,6 +77,7 @@ ARG TOGETHER_API_KEY
ARG TOGETHER_API_BASE_URL
ARG VITE_LOG_LEVEL=debug
ARG DEFAULT_NUM_CTX
ARG VITE_ALLOWED_HOSTS

ENV GROQ_API_KEY=${GROQ_API_KEY} \
HuggingFace_API_KEY=${HuggingFace_API_KEY} \
Expand All @@ -89,7 +92,8 @@ ENV GROQ_API_KEY=${GROQ_API_KEY} \
AWS_BEDROCK_CONFIG=${AWS_BEDROCK_CONFIG} \
VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}\
RUNNING_IN_DOCKER=true
RUNNING_IN_DOCKER=true\
VITE_ALLOWED_HOSTS=${VITE_ALLOWED_HOSTS}

RUN mkdir -p ${WORKDIR}/run
CMD pnpm run dev --host
13 changes: 13 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ import { join } from 'path';

dotenv.config();


// Define allowed hosts based on the VITE_ALLOWED_HOSTS environment variable
// If the environment variable is not set, default to an empty array
const allowedHosts = process.env.VITE_ALLOWED_HOSTS
? process.env.VITE_ALLOWED_HOSTS.split(',')
.filter(host => host.trim() !== '')
.map(host => host.trim())
: []


// Get detailed git info with fallbacks
const getGitInfo = () => {
try {
Expand Down Expand Up @@ -166,6 +176,9 @@ export default defineConfig((config) => {
},
},
},
server: {
allowedHosts
}
};
});

Expand Down
Loading