Principal >
Biblioteca >
Manuales de Instalación > Conexión a LM Studio local por medio de un API Key
Conexión a LM Studio local por medio de un API Key
Arrancar la aplicación de LM Studio.
Arrancar el servidor: lms server start
Starting server...
Success! Server is now running on port 1234
Para que funcione en python instalamos la biblioteca que se necesita:
pip3 install lmstudio
Hacer el código en Python:
import lmstudio as lms
#model = lms.llm("llama-3.2-1b-instruct")
model = lms.llm("deepseek-r1-distill-qwen-7b")
result = model.respond("What is the meaning of life?")
print(result)
Y la respuesta que imprime es:
The question "What is the meaning of life?" touches on a deep and universal philosophical issue. For different people, it may have various interpretations. Some might find meaning in personal achievements or relationships, while others might discover meaning through religion, art, or science. In essence, finding a meaningful purpose involves reflecting deeply on one's own beliefs, values, and aspirations, and integrating these with life's experiences to achieve harmony and satisfaction.
Usted se encuentra Aquí >
Principal >
Biblioteca >
Manuales de Instalación > Conexión a LM Studio local por medio de un API Key
Portal de Tecnología desarrollado por: Rogelio Ferreira Escutia