added products section, and reorganized and improved the docs
75
.github/workflows/jan-astro-docs.yml
vendored
@ -1,75 +0,0 @@
|
||||
name: Deploy Astro Docs (v2)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- 'website/**'
|
||||
- '.github/workflows/jan-astro-docs.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'website/**'
|
||||
- '.github/workflows/jan-astro-docs.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to v2.jan.ai
|
||||
env:
|
||||
# IMPORTANT: You will need to create a new Cloudflare Pages project
|
||||
# and name it "jan-v2" or update this value to your new project name.
|
||||
CLOUDFLARE_PROJECT_NAME: jan-v2
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: website
|
||||
run: npm install
|
||||
|
||||
- name: Build Astro Docs
|
||||
working-directory: website
|
||||
# No PUBLIC_BASE_PATH is set, so it builds for the root, which is correct for a subdomain
|
||||
run: npm run build
|
||||
|
||||
- name: Publish to Cloudflare Pages (PR Preview)
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: cloudflare/pages-action@v1
|
||||
id: deployPreview
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
|
||||
directory: ./website/dist
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Add PR Comment with Preview URL
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: mshick/add-pr-comment@v2
|
||||
with:
|
||||
message: |
|
||||
🚀 Astro docs preview is ready!
|
||||
URL: ${{ steps.deployPreview.outputs.url }}
|
||||
|
||||
- name: Publish to Cloudflare Pages (Production)
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/dev') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev')
|
||||
uses: cloudflare/pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
|
||||
directory: ./website/dist
|
||||
# This deploys to the production branch of your new Cloudflare project
|
||||
branch: main
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
@ -15,16 +15,16 @@
|
||||
"type": "page",
|
||||
"title": "Products"
|
||||
},
|
||||
"local-server": {
|
||||
"type": "page",
|
||||
"title": "Jan Local Server",
|
||||
"display": "hidden"
|
||||
},
|
||||
"cortex": {
|
||||
"type": "page",
|
||||
"title": "Cortex",
|
||||
"display": "hidden"
|
||||
},
|
||||
"platforms": {
|
||||
"type": "page",
|
||||
"title": "Platforms",
|
||||
"display": "hidden"
|
||||
},
|
||||
"integrations": {
|
||||
"type": "page",
|
||||
"title": "Integrations",
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
BIN
docs/src/pages/docs/_assets/api-server-ui.png
Normal file
|
After Width: | Height: | Size: 562 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
@ -40,6 +40,15 @@
|
||||
"mcp": "Model Context Protocol",
|
||||
"mcp-examples": "MCP Examples",
|
||||
|
||||
"localserver": {
|
||||
"title": "LOCAL SERVER",
|
||||
"type": "separator"
|
||||
},
|
||||
"api-server": "Server Setup",
|
||||
"llama-cpp-server": "LlamaCpp Server",
|
||||
"server-settings": "Server Settings",
|
||||
"server-troubleshooting": "Server Troubleshooting",
|
||||
"server-examples": "Integrations",
|
||||
"reference-separator": {
|
||||
"title": "REFERENCE",
|
||||
"type": "separator"
|
||||
|
||||
100
docs/src/pages/docs/api-server.mdx
Normal file
@ -0,0 +1,100 @@
|
||||
---
|
||||
title: Local API Server
|
||||
description: Run Jan's OpenAI-compatible API server on your local machine for private, offline AI development.
|
||||
keywords:
|
||||
[
|
||||
Jan,
|
||||
local AI server,
|
||||
OpenAI API,
|
||||
local API,
|
||||
self-hosted AI,
|
||||
offline AI,
|
||||
privacy-focused AI,
|
||||
API integration,
|
||||
local LLM server,
|
||||
llama.cpp,
|
||||
CORS,
|
||||
API key
|
||||
]
|
||||
---
|
||||
import { Callout, Steps } from 'nextra/components'
|
||||
|
||||
# Local API Server
|
||||
|
||||
Jan provides a built-in, OpenAI-compatible API server that runs entirely on your computer, powered by `llama.cpp`. Use it as a drop-in replacement for cloud APIs to build private, offline-capable AI applications.
|
||||
|
||||

|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
### Start the Server
|
||||
1. Navigate to **Settings** > **Local API Server**.
|
||||
2. Enter a custom **API Key** (e.g., `secret-key-123`). This is required for all requests.
|
||||
3. Click **Start Server**.
|
||||
|
||||
The server is ready when the logs show `JAN API listening at http://127.0.0.1:1337`.
|
||||
|
||||
### Test with cURL
|
||||
Open a terminal and make a request. Replace `YOUR_MODEL_ID` with the ID of an available model in Jan.
|
||||
|
||||
```bash
|
||||
curl http://127.0.0.1:1337/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer secret-key-123" \
|
||||
-d '{
|
||||
"model": "YOUR_MODEL_ID",
|
||||
"messages": [{"role": "user", "content": "Tell me a joke."}]
|
||||
}'
|
||||
```
|
||||
</Steps>
|
||||
|
||||
## Server Configuration
|
||||
|
||||
These settings control the network accessibility and basic behavior of your local server.
|
||||
|
||||
### Server Host
|
||||
The network address the server listens on.
|
||||
- **`127.0.0.1`** (Default): The server is only accessible from your own computer. This is the most secure option for personal use.
|
||||
- **`0.0.0.0`**: The server is accessible from other devices on your local network (e.g., your phone or another computer). Use this with caution.
|
||||
|
||||
### Server Port
|
||||
The port number for the API server.
|
||||
- **`1337`** (Default): A common alternative port.
|
||||
- You can change this to any available port number (e.g., `8000`).
|
||||
|
||||
### API Prefix
|
||||
The base path for all API endpoints.
|
||||
- **`/v1`** (Default): Follows OpenAI's convention. The chat completions endpoint would be `http://127.0.0.1:1337/v1/chat/completions`.
|
||||
- You can change this or leave it empty if desired.
|
||||
|
||||
### API Key
|
||||
A mandatory secret key to authenticate requests.
|
||||
- You must set a key. It can be any string (e.g., `a-secure-password`).
|
||||
- All API requests must include this key in the `Authorization: Bearer YOUR_API_KEY` header.
|
||||
|
||||
### Trusted Hosts
|
||||
A comma-separated list of hostnames allowed to access the server. This provides an additional layer of security when the server is exposed on your network.
|
||||
|
||||
## Advanced Settings
|
||||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
- **(Enabled by default)** Allows web applications (like a custom web UI you are building) running on different domains to make requests to the API server.
|
||||
- **Disable this** if your API will only be accessed by non-browser-based applications (e.g., scripts, command-line tools) for slightly improved security.
|
||||
|
||||
### Verbose Server Logs
|
||||
- **(Enabled by default)** Provides detailed, real-time logs of all incoming requests, responses, and server activity.
|
||||
- This is extremely useful for debugging application behavior and understanding exactly what is being sent to the models.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
<Callout>
|
||||
Ensure **Verbose Server Logs** are enabled to get detailed error messages in the "Server Logs" view.
|
||||
</Callout>
|
||||
|
||||
- **Connection Refused:** The server is not running, or your application is pointing to the wrong host or port.
|
||||
- **401 Unauthorized:** Your API Key is missing from the `Authorization` header or is incorrect.
|
||||
- **404 Not Found:**
|
||||
- The `model` ID in your request body does not match an available model in Jan.
|
||||
- Your request URL is incorrect (check the API Prefix).
|
||||
- **CORS Error (in a web browser):** Ensure the CORS toggle is enabled in Jan's settings.
|
||||
@ -21,7 +21,11 @@ import { Settings } from 'lucide-react'
|
||||
|
||||
# Local AI Engine (llama.cpp)
|
||||
|
||||
llama.cpp is the engine that runs AI models locally on your computer. It's what makes Jan work without needing internet or cloud services.
|
||||
`llama.cpp` is the core **inference engine** Jan uses to run AI models locally on your computer. This section covers the settings for the engine itself, which control *how* a model processes information on your hardware.
|
||||
|
||||
<Callout>
|
||||
Looking for API server settings (like port, host, CORS)? They have been moved to the dedicated [**Local API Server**](/docs/local-server/api-server) page.
|
||||
</Callout>
|
||||
|
||||
## Accessing Engine Settings
|
||||
|
||||
@ -155,7 +155,7 @@ These control how models use your computer's memory:
|
||||
|
||||
### KV Cache Types Explained
|
||||
- **f16**: Most stable, uses more memory
|
||||
- **q8_0**: Balanced memory usage and quality
|
||||
- **q8_0**: Balanced memory usage and quality
|
||||
- **q4_0**: Uses least memory, slight quality loss
|
||||
|
||||
## Troubleshooting Common Issues
|
||||
|
||||
@ -164,41 +164,17 @@ Jan stores everything locally on your computer in standard file formats.
|
||||
This duplicates your data to the new location - your original files stay safe.
|
||||
</Callout>
|
||||
|
||||
## Network Settings
|
||||
## Local API Server
|
||||
|
||||
### HTTPS Proxy Setup
|
||||
All settings for running Jan as a local, OpenAI-compatible server have been moved to their own dedicated page for clarity.
|
||||
|
||||
If you need to connect through a corporate network or want enhanced privacy:
|
||||
This includes configuration for:
|
||||
- Server Host and Port
|
||||
- API Keys
|
||||
- CORS (Cross-Origin Resource Sharing)
|
||||
- Verbose Logging
|
||||
|
||||
1. **Enable** the proxy toggle
|
||||
2. Enter your proxy details:
|
||||
```
|
||||
http://<username>:<password>@<server>:<port>
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
http://user:pass@proxy.company.com:8080
|
||||
```
|
||||
|
||||

|
||||
|
||||
<Callout type="info">
|
||||
Proxy connections may slow down model downloads but don't affect local model performance.
|
||||
</Callout>
|
||||
|
||||
### SSL Certificate Handling
|
||||
|
||||
**Ignore SSL Certificates:** Only enable this for:
|
||||
- Corporate networks with internal certificates
|
||||
- Development/testing environments
|
||||
- Trusted network setups
|
||||
|
||||

|
||||
|
||||
<Callout type="warning">
|
||||
Only enable if you trust your network environment completely.
|
||||
</Callout>
|
||||
[**Go to Local API Server Settings →**](/docs/local-server/api-server)
|
||||
|
||||
## Emergency Options
|
||||
|
||||
|
Before Width: | Height: | Size: 163 KiB |
|
Before Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 598 KiB |
|
Before Width: | Height: | Size: 306 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 450 KiB |
|
Before Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 453 KiB |
|
Before Width: | Height: | Size: 524 KiB |
|
Before Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 541 KiB |
|
Before Width: | Height: | Size: 257 KiB |
|
Before Width: | Height: | Size: 537 KiB |
|
Before Width: | Height: | Size: 576 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 487 KiB |
|
Before Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 343 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 22 MiB |
|
Before Width: | Height: | Size: 4.4 MiB |
|
Before Width: | Height: | Size: 819 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 512 KiB |
|
Before Width: | Height: | Size: 199 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 337 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 992 KiB |
|
Before Width: | Height: | Size: 439 KiB |
|
Before Width: | Height: | Size: 284 KiB |
|
Before Width: | Height: | Size: 514 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 970 KiB |
|
Before Width: | Height: | Size: 364 KiB |
|
Before Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 513 KiB |
|
Before Width: | Height: | Size: 632 KiB |
|
Before Width: | Height: | Size: 963 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 757 KiB |
|
Before Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 457 KiB |
|
Before Width: | Height: | Size: 681 KiB |
|
Before Width: | Height: | Size: 230 KiB |
|
Before Width: | Height: | Size: 405 KiB |
|
Before Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 745 KiB |
|
Before Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 999 KiB |
|
Before Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 648 KiB |
|
Before Width: | Height: | Size: 490 KiB |
|
Before Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 685 KiB |
|
Before Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 148 KiB |
|
Before Width: | Height: | Size: 231 KiB |
|
Before Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 775 KiB |
|
Before Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 562 KiB |
|
Before Width: | Height: | Size: 447 KiB |
|
Before Width: | Height: | Size: 678 KiB |
|
Before Width: | Height: | Size: 679 KiB |