-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let the ollama models be auto generated from ollama api #5
Conversation
I have nodejs installed v20.18.0 and pnpm 9.12.2.
*** Received structured exception #0xc0000005: access violation; stack: 7ffc0cae301f 7ff676e0337b 7ff676e03443 7ff676df74bc 7ff676df7467 7ff676677d5e 7ff67667806f 7ff675561706 7ff6755614ea 7ff6767ef97f 7ff6767f6b36 7ff6767efe9c 7ff6767f6b36 7ff6767ed80c 7ff675551551 7ff677ed8bff 7ffc1a99257c 7ffc1c10af07 |
@yunatamos This is a much needed addition so people aren't selecting Ollama models they haven't pulled yet - thank you!! |
@coleam00 @yunatamos is there anything special we need to do in order to get the auto-poll of Ollama models to work if I want to access Bolt over my own network (i.e. not localhost)? I looked at the files changed, nothing seems out of the ordinary, but I for sure am getting a CORS error. I tried making the change to vite.config.ts below but it still doesn't work. import { cloudflareDevProxyVitePlugin as remixCloudflareDevProxy, vitePlugin as remixVitePlugin } from '@remix-run/dev';
import UnoCSS from 'unocss/vite';
import { defineConfig, type ViteDevServer } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import { optimizeCssModules } from 'vite-plugin-optimize-css-modules';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig((config) => {
return {
build: {
target: 'esnext',
},
server: {
proxy: {
'/api': {
target: 'http://localhost:11434',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
}
},
headers: {
"access-control-allow-origin": "*"
}
},
plugins: [
nodePolyfills({
include: ['path', 'buffer'],
}),
config.mode !== 'test' && remixCloudflareDevProxy(),
remixVitePlugin({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
}),
UnoCSS(),
tsconfigPaths(),
chrome129IssuePlugin(),
config.mode === 'production' && optimizeCssModules({ apply: 'build' }),
],
};
});
function chrome129IssuePlugin() {
return {
name: 'chrome129IssuePlugin',
configureServer(server: ViteDevServer) {
server.middlewares.use((req, res, next) => {
const raw = req.headers['user-agent']?.match(/Chrom(e|ium)\/([0-9]+)\./);
if (raw) {
const version = parseInt(raw[2], 10);
if (version === 129) {
res.setHeader('content-type', 'text/html');
res.end(
'<body><h1>Please use Chrome Canary for testing.</h1><p>Chrome 129 has an issue with JavaScript modules & Vite local development, see <a href="https://github.com/stackblitz/bolt.new/issues/86#issuecomment-2395519258">for more information.</a></p><p><b>Note:</b> This only impacts <u>local development</u>. `pnpm run build` and `pnpm run start` will work fine in this browser.</p></body>',
);
return;
}
}
next();
});
},
};
} |
hi I harcoded the link and its not in env I will try figure it out how to get link updated in .env am new to this had some issues with env varible working in server but not in client I dont know why |
async function getOllamaModels(): Promise<ModelInfo[]> { | ||
try { | ||
const response = await fetch(`http://localhost:11434/api/tags`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, there is a hardcoded ref to localhost instead of using the .env.
I'm having the exact same issue. Was anyone able to get past this and get it to work? |
let the ollama models be auto generated from ollama api
with the current implementation user doesnt select custom models so I made it possible to have user select available models