Mudanças entre as edições de "Ollama"
Ir para navegação
Ir para pesquisar
(→Models) |
|||
| Linha 76: | Linha 76: | ||
=Ollama API= | =Ollama API= | ||
| − | ==Models== | + | ==List Models== |
| + | GET /api/tags | ||
| + | [[https://github.com/ollama/ollama/blob/main/docs/api.md#list-local-models https://github.com/ollama/ollama/blob/main/docs/api.md#list-local-models]] | ||
| + | |||
==Generator== | ==Generator== | ||
POST /api/generate | POST /api/generate | ||
Edição das 07h23min de 7 de março de 2025
Índice
Ollama
Modo debug
/set verbose
Prompt: Hello
>>> Hello
Resposta:
Hello! How are you today? Is there something I can help you with, or would you like to chat? total duration: 678.164416ms load duration: 18.576248ms prompt eval count: 11 token(s) prompt eval duration: 131.281ms prompt eval rate: 83.79 tokens/s eval count: 24 token(s) eval duration: 486.965ms eval rate: 49.28 tokens/s
Configurações
Prompt:
>>> /set system "Responsa em portugues, o mais preciso possível, e no máximo em duas linhas"
Resposta:
Set system message.
Sobre o modelo
Prompt:
>>> /show
Response:
Available Commands: /show info Show details for this model /show license Show model license /show modelfile Show Modelfile for this model /show parameters Show parameters for this model /show system Show system message /show template Show prompt template
Prompt 2:
>>> /show info
Sair do modulo
Prompt:
>>> /clear
Resposta:
Cleared session context
Ollama Comandos
Listas os modelos existentes
ollama list
Removento modelos existentes
ollama rm gemma2:27b
Criando um modelo
ollama create brapci
Modelo do arquivo de criação (modelo.txt):
FROM llama3.3:latest PARAMETER temperature 0.1 PARAMETER num_ctx 1024 SYSTEM Responsa em no máximo 2 linhas em portugues. Respostas curtas e precisas.
Criando o modelo Prompt:
ollama create brapci -f ./model.txt
Resposta:
transferring model data using existing layer sha256:8eeb52dfb3bb9aefdf9d1ef24b3bdbcfbe82238798c4b918278320b6fcef18fe using existing layer sha256:948af2743fc78a328dcb3b0f5a31b3d75f415840fdb699e8b1235978392ecf85 using existing layer sha256:0ba8f0e314b4264dfd19df045cde9d4c394a52474bf92ed6a3de22a4ca31a177 creating new layer sha256:55dcf8076ae23604428d8b4e3da7b4cf1f7901d56cd5c372b35019e89fc55329 creating new layer sha256:dd8a35e7060436c1dfed155f80c14ea5cb012a4a3c0c460bf4087ceffdb62d4d creating new layer sha256:dd7674e7d8fe16dad131bde90382cc861eaa698bf78a259215512f68d55be608 writing manifest success
Ollama API
List Models
GET /api/tags [https://github.com/ollama/ollama/blob/main/docs/api.md#list-local-models]
Generator
POST /api/generate [https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-completion]
Chat
POST /api/chat [https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion]