Skip to main content

llama-index llms lmstudio integration

Project description

LlamaIndex Llms Integration: Lmstudio

pip install llama-index-llms-lmstudio

Usage Steps

  1. Open LM Studio App and go to the Local Server Tab
  2. In the Configuration settings, enable Apply Prompt Formatting
  3. Load the model of your choice
  4. Start your server
from llama_index.llms.lmstudio import LMStudio

llm = LMStudio(
    model_name="Hermes-2-Pro-Llama-3-8B",
    base_url="http://localhost:1234/v1",
    temperature=0.7,
)

messages = [
    ChatMessage(
        role=MessageRole.SYSTEM,
        content="You an expert AI assistant. Help User with their queries.",
    ),
    ChatMessage(
        role=MessageRole.USER,
        content="What is the significance of the number 42?",
    ),
]

response = llm.chat(messages=messages)
print(str(response))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_llms_lmstudio-0.4.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_llms_lmstudio-0.4.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_lmstudio-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_llms_lmstudio-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c09ae28e289fe8d561dfa77f63fe01ad42881d0568b929f8171a8739e1ad9e31
MD5 26f1d21dc5f21a20ba21808b1f94d400
BLAKE2b-256 b7c284c6892d8009cf41e877499f75206c64decedc9ed4de15ec2b9aa0e7643c

See more details on using hashes here.

File details

Details for the file llama_index_llms_lmstudio-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_llms_lmstudio-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2c26d8d28c14b1bb39382ad0fcf50d2e803a08fe6361ad96e96f4d392ccffbe
MD5 2baad81cdad48a0cb88f7008a97ea3ff
BLAKE2b-256 de57f5c057e323be5856ab4a2afff3c4eb71c7876654e30edefb1848a1e42669

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page