ollama_push
Upload a local Ollama model to the registry to make it available for remote access and deployment.
Instructions
Push a model to the Ollama registry. Uploads a local model to make it available remotely.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Name of the model to push | |
| insecure | No | Allow insecure connections | |
| format | No | json |
Implementation Reference
- src/tools/push.ts:10-23 (handler)The pushModel function that executes the core logic of pushing a model to the Ollama registry using ollama.push().export async function pushModel( ollama: Ollama, model: string, insecure: boolean, format: ResponseFormat ): Promise<string> { const response = await ollama.push({ model, insecure, stream: false, }); return formatResponse(JSON.stringify(response), format); }
- src/schemas.ts:156-162 (schema)Zod schema definition for validating the input parameters of the ollama_push tool (model, insecure, format).* Schema for ollama_push tool */ export const PushModelInputSchema = z.object({ model: z.string().min(1), insecure: z.boolean().default(false), format: ResponseFormatSchema.default('json'), });
- src/tools/push.ts:25-53 (registration)The toolDefinition object that registers the ollama_push tool, including name, description, inline inputSchema, and handler wrapper that uses the schema for validation.export const toolDefinition: ToolDefinition = { name: 'ollama_push', description: 'Push a model to the Ollama registry. Uploads a local model to make it available remotely.', inputSchema: { type: 'object', properties: { model: { type: 'string', description: 'Name of the model to push', }, insecure: { type: 'boolean', description: 'Allow insecure connections', default: false, }, format: { type: 'string', enum: ['json', 'markdown'], default: 'json', }, }, required: ['model'], }, handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => { const validated = PushModelInputSchema.parse(args); return pushModel(ollama, validated.model, validated.insecure, format); }, };