Download packages/server/src/handlers/model.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/model.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/server/src/handlers/model.ts
-
curl -L -o model.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/model.ts
530 Bytes
| import { Catalog } from "@opencode-ai/core/catalog" | |
| import { Effect } from "effect" | |
| import { HttpApiBuilder } from "effect/unstable/httpapi" | |
| import { Api } from "../api" | |
| import { response } from "../location" | |
| export const ModelHandler = HttpApiBuilder.group(Api, "server.model", (handlers) => | |
| Effect.gen(function* () { | |
| return handlers.handle( | |
| "model.list", | |
| Effect.fn(function* () { | |
| const catalog = yield* Catalog.Service | |
| return yield* response(catalog.model.available()) | |
| }), | |
| ) | |
| }), | |
| ) | |