tinycodinglm / lmstudio /lmstudio-0000.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 15)
b27bfb3 verified
|
Raw History Blame Contribute Delete
1.73 kB
opencode trace
System You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing c...

You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies.

User

How do I set up LM Studio for local inference? Show downloading a model, loading it, starting the server on localhost:1234, and verifying with /v1/models. Include code examples.

Assistant

LM Studio local setup:

  1. Download: https://lmstudio.ai - Windows, Mac, Linux.
  2. Install and launch the app.
  3. Download a model: Models tab -> search -> Download (pick a size that fits your RAM/VRAM).
  4. Load: select the downloaded model -> Load Model.
  5. Serve: Local Server tab -> Start Server (default http://localhost:1234).
bash
# Verify server is running (lists loaded model ids)
curl http://localhost:1234/v1/models

Use the returned id as model in OpenAI-compatible calls with base_url="http://localhost:1234/v1" and any non-empty api_key when auth is disabled.

Key settings:

  • Context length: max tokens visible at once (varies by model)
  • GPU offload: layers on GPU (more = faster if VRAM allows)
  • Temperature: 0.0 deterministic, higher = more creative
  • Top-p: nucleus sampling, 0.9 typical