For Model Builders

Give the model you're building its own address. Your agent can use it, others can try it, and you restart it as often as you like.

Use a model at its own address

A model served on a port of its own is then a model like Ollama's. lnk agent start --model <model> uses it, and lnk model share --model <model> shares it.

lnk model runtime add http://localhost:5000 --name mymodel # remember your server, and list shows its models
lnk model runtime remove mymodel                           # by the name it was added as, and the server keeps running

What your server answers

Your server needs to answer OpenAI's /v1/models and /v1/chat/completions, as vLLM and llama.cpp do. Link adds only an address on this machine, which is localhost, 127.0.0.1 or [::1]. While nothing answers there, list shows it as not answering.

Demo a model you're building

The URL stays the same while you restart your server, and requests fail only while it's down.

lnk model share --upstream http://localhost:5000 --name mymodel --auth  # its OpenAI-style /v1 API
lnk tunnel open 5000 --name mymodel --auth                                 # any other API, every route as is

Which to use

The first command needs a server that answers /v1/models and /v1/chat/completions, as above. The second forwards whatever your server answers, such as a Gradio app or your own routes. For your agent to use it too, add it with lnk model runtime add (above).