For Developers

For people who build models: give the one you're serving its own address, use it from your agent, and let others try it, while you restart it as often as you like.

Use a model at its own address

lnk model add http://localhost:5000 --name mymodel # remember your server; list shows its models
lnk model forget mymodel                           # the address or the name; the server keeps running

A model you're building, served on a port of its own, is then a model like Ollama's: lnk agent start --model <model> uses it, and lnk tunnel open <model> shares it. 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: localhost, 127.0.0.1 or [::1]. While nothing answers there, list shows it as not answering.

Demo a model you're building

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

A model you're training or serving from your own code works like any other. The first command needs your server to answer OpenAI's /v1/models and /v1/chat/completions, as vLLM and llama.cpp do. The second forwards whatever your server answers, such as a Gradio app or your own routes. Restart your server as often as you like: requests fail while it's down, and the URL stays the same.

For your agent to use it too, add it with lnk model add (above).